Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

utl_file.open_file question to check if a file exists and is not empty

user_shravMar 29 2012 — edited Mar 30 2012
Hello,

I am trying to write a code where in 3 seperate files are created based on some parameter condition for the extract call.
Say the parameters are NULL, 'A' and 'B'.
When Null condition is passed to the extract call then it should create file A and B if records are found. If not it should create empty files.
It is possible that the parameter to the extract is just 'A' then it would create A with say non zero file and B with zero file.
Now when the extract is called with 'B' parameter and if the file A already exists and is not empty then I should not touch/overwrite it with empty records.
Is there any simple way that I can do this to check if a file exists and is non empty?

I am using
open_file
( gv_utl_file_path
,lv_file_name
,lv_file_handle
);

Please help.
Thanks
This post has been answered by jeneesh on Mar 29 2012
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Apr 27 2012
Added on Mar 29 2012
6 comments
8,407 views