My System is a Windows 2000 stand-alone with Oracle8i installed. I am the Oracle Admin in this system and have granted all the system privileges necessary to administer the database.
I am trying to output the result of a simple SQL query into a *.txt file on my local C:\temp drive. While I get PL/SQL successfully completed. when I go the c:\temp directory, I do not see the *.txt file.
Here are my settings and the anonymous pl/sql:
utl_file_dir = c:\temp
the Database was restarted after puting the line above
SQL> create directory utl_file_dir as 'c:\temp';
SQL> grant write, read on directory utl_file_dir to scott;
emp:= utl_file.fopen( 'c:\temp', 'test.txt', 'W' );
FOR emp IN (SELECT emp_name FROM employees)
utl_file.put_line( emp.emp_name );
2 emp UTL_FILE.FILE_TYPE;
4 emp:= utl_file.fopen( 'c:\temp', 'test.txt', 'W' );
5 FOR emp IN (SELECT emp_name FROM employees)
7 utl_file.put_line( emp.emp_name );
8 END LOOP;
PL/SQL successfully completed.
I then go to my c:\temp directory to look for the test.txt file and I can t find it. I click on refresh and still nothing. I did system wide search and still nothing. What am I doing wrong here??
Originally posted by alexxx15
The server and the client are one and the same. That is my home pc is the a stand-alone with Oracle8i installed on it.
I dont know if that is the reason, but too many variables with
the same name (emp).
your file pointer is also called emp and cursor index is also emp.
why dont you change one of them.
say why not try.