Skip to Main Content
  • Questions
  • Frename function not working consistently in PL/SQL

Breadcrumb

Question and Answer

Connor McDonald

Thanks for the question, Hatim Ali.

Asked: January 13, 2017 - 6:59 am UTC

Last updated: January 13, 2017 - 7:28 am UTC

Version: Oracle 11g

Viewed 1000+ times

You Asked

Hi,

I have a PL/SQL proc to rename files under directory.

I am using the below function to rename the files :-

UTL_FILE.FRENAME('ATTDIR', FILE_NAME2, 'ATTDIR', V_ID1, TRUE);

The files are existing on the directory even though the PL/SQL proc is not able to convert all the files and exists mid-way giving below error.

Error report -
ORA-29283: invalid file operation
ORA-06512: at "SYS.UTL_FILE", line 348
ORA-06512: at "SYS.UTL_FILE", line 1290
ORA-06512: at line 28
29283. 00000 - "invalid file operation"
*Cause: An attempt was made to read from a file or directory that does
not exist, or file or directory access was denied by the
operating system.
*Action: Verify file and directory access privileges on the file system,
and if reading, verify that the file exists.

Can anyone support on this issue :-

and Connor said...

The error is pretty self explanatory...either

a) the file name was not correct (and hence it could not be found)
b) you (ie, the oracle database account) did not have sufficient rights to perform the file operation.

If you can *definitively* prove that neither of these is true, then its time to contact Support with your test case to file a bug.

Is this answer out of date? If it is, please let us know via a Comment