hello, Ii got an error when I want to use my directory created inside UTL_FILE.FOPEN invalid directory path within the procedure to open a certain file on my local machine.
Question
Share
Sign Up to our social questions and Answers to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers to ask questions, answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
utl_file.fopen takes the name of a directory, not the path. For example:
(you may need to login as SYS to execute these)
[code]Windows:
CREATE DIRECTORY CUST_DIR AS ‘C:’;
Linux
CREATE DIRECTORY CUST_DIR AS ‘/usr/tmp’;
GRANT READ ON DIRECTORY CUST_DIR TO SCOTT;[/code]
Then, you can refer to it in the call to fopen:
[code]
UTL_FILE.FOPEN(‘CUST_DIR’, ‘oraask_test.txt’, ‘W’);
[/code]
hope this help.