Access the answers to your technology questions today.
Subscribe Now
30-day free trial. Register in 60 seconds.
What Makes Experts Exchange Unique?
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.
Try it out and discover for yourself.
Subscribe Now
30-day free trial. Register in 60 seconds.
Join the Community
Give a Little. Get a Lot.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
Join the Community
by: jpkempPosted on 2003-04-13 at 18:14:28ID: 8323981
1. For complex tasks it is usually preferable to create a package with a variety of procedures, so that your solution is modularized. Additional benefit is use of package variables to retain state.
p_file,'r' );
.csv') THEN
2. Create the following function:
FUNCTION file_present (p_location IN VARCHAR2, p_file IN VARCHAR2) RETURN BOOLEAN IS
BEGIN
v_fp := UTL_FILE.FOPEN(p_location,
UTL_FILE.FCLOSE(v_fp);
RETURN TRUE;
EXCEPTION
WHEN OTHERS THEN
RETURN FALSE;
END file_present;
In your code:
IF file_present('X:\','myfile
--execute the procedure;
END IF;
Note that 'location' must be an accessible directory, as defined in the instance’s initialization parameter UTL_FILE_DIR.
Jeff