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!

File access Invalid Operation

user12093849Mar 28 2011 — edited Mar 28 2011
using Oracle 10g,

when I am running the procedure, it is not creating the data file in the target directory ,instead i am getting the
DBD::Oracle::st execute failed: ORA-20001: ORACLE ERROR: ORA-20102: Invalid Operation
and also,I created the TEST_TEMP using create directory script
and the file name is given with all access and still ,it is not creating the file in the target directory

and the same script,if I run from TEST or Prod,it is creating the file with out any problem

could you pls let me know if i am missing any settings
PROCEDURE EXTRACTFILE(in_filename IN VARCHAR2) AS
	vDir    VARCHAR2(50) := 'TEST_TEMP';   
BEGIN
  file_io.open_write(vDir,in_filename);
   
      FOR x IN
         (SELECT item,
                 SOURCE,
                 DEST,
                 qty
            FROM product ) LOOP

          file_io.write_buf(
             x.item || ';' ||
             x.SOURCE || ';' ||
             x.dest || ';' ||
             x.qty );

       END LOOP;
   
   file_io.close_file;

   commit;

EXCEPTION
  WHEN OTHERS THEN
    Proc_Stat_Util.Write_Bad_Msg( 'ORACLE ERROR: '||DBMS_UTILITY.FORMAT_ERROR_STACK );
    COMMIT;
    RAISE_APPLICATION_ERROR(-20001,'ORACLE ERROR: '||DBMS_UTILITY.FORMAT_ERROR_STACK );
END; 
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Apr 25 2011
Added on Mar 28 2011
6 comments
1,308 views