This content has been marked as final. Show 5 replies
Oracle recommends using directory objects instead of actual paths (see this link for the 11gR2 documentation). Perhaps the paths you specified are not specified in the utl_file_dir parameter? Directory objects provide more flexibility than utl_file_dir usage. Use them if you can.
Also, you stated that you had write permissions to the directory. The Oracle software owner, typically the oracle user, is the user that needs the permissions.
Edited by: rbglossip on Mar 10, 2010 7:09 PM
We are using oracle 10g release 1.
I can write the file to the specified directory, If I can do that, why I cant i rename the file to some other name?
I'm assuming you are using utl_file to write the file.
Checking the documentation for error 29280, seems frename might not accept actual paths and expects directory objects instead. I know fopen supports paths for backward compatibility, not sure about frename. Can you use a directory object instead?
user5679956 wrote:Perhaps you should read how this API call works and what the parameters are, instead of guessing?
I am trying to rename a file and is not working.
Oracle® Database PL/SQL Packages and Types Reference guide describes this all as follows (http://download.oracle.com/docs/cd/B19306_01/appdev.102/b14258/u_file.htm#i1003641):
Where does it say you can simply slap a physical directory path on as call parameter for location? It specifically states that a dir object is needed.
location The directory location of the source file, a DIRECTORY_NAME from the ALL_DIRECTORIES view (case sensitive). filename The source file to be renamed. dest_dir The destination directory of the destination file, a DIRECTORY_NAME from the ALL_DIRECTORIES view (case sensitive). dest_file The new name of the file. overwrite The default is FALSE.
One of the very fundamentals for any programmer is to know what you are coding. This means knowing EXACTLY what the call does and what the parameters are, and what (if any) the response will be. Writing code based in guessing is one of the worse programming sins in my book (next to not modularising code design).
create directory DEV as 'trans/CARDS/dev'; BEGIN utl_file.frename('DEV','abc_EXT.LOG', 'DEV','x.log',TRUE); END frename; /