![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
|
Hello, on the database server running Oracle 9.2, I want to write to a log file. *I unsuccessfully tried the following: DECLARE * * * f UTL_FILE.FILE_TYPE; BEGIN * * * f := UTL_FILE.FOPEN('d:\temp', 'log.txt', 'w'); END; / It says, 'ORA-29280: invalid directory path' even if that folder exists and the permissions allow everyone to write to it. Someone told me to create a directory object so I can grant permissions to it, as follows: CREATE OR REPLACE DIRECTORY dirobj as 'd:\temp'; GRANT READ,WRITE ON DIRECTORY dirobj to snakason; CONN snakason/mypass@hedev2 DECLARE * * * f UTL_FILE.FILE_TYPE; BEGIN * * * f := UTL_FILE.FOPEN(dirobj, 'log.txt', 'r', 5000); END; / But now I'm getting this error "PLS-00201: identifier 'DIROBJ' must be declared". *I'm guessing dirobj is not in scope of the PL/SQL block, but how to I remedy that? *If I put those lines within the PL/SQL block, I get errors. *Sorry, I'm an Oracle newbie so I don't what works or does not work in a PL/SQL block. |
#2
| |||
| |||
|
|
Hello, on the database server running Oracle 9.2, I want to write to a log file. I unsuccessfully tried the following: DECLARE f UTL_FILE.FILE_TYPE; BEGIN f := UTL_FILE.FOPEN('d:\temp', 'log.txt', 'w'); END; / It says, 'ORA-29280: invalid directory path' even if that folder exists and the permissions allow everyone to write to it. Someone told me to create a directory object so I can grant permissions to it, as follows: CREATE OR REPLACE DIRECTORY dirobj as 'd:\temp'; GRANT READ,WRITE ON DIRECTORY dirobj to snakason; CONN snakason/mypass@hedev2 DECLARE f UTL_FILE.FILE_TYPE; BEGIN f := UTL_FILE.FOPEN(dirobj, 'log.txt', 'r', 5000); END; / But now I'm getting this error "PLS-00201: identifier 'DIROBJ' must be declared". I'm guessing dirobj is not in scope of the PL/SQL block, but how to I remedy that? If I put those lines within the PL/SQL block, I get errors. Sorry, I'm an Oracle newbie so I don't what works or does not work in a PL/SQL block. |
![]() |
| Thread Tools | |
| Display Modes | |
| |