Issues with writing to server-side log file.

From: seannakasone <snakason_at_flex.com>
Date: Fri, 6 Feb 2009 10:55:51 -1000
Message-ID: <Pine.CYG.4.58.0902061054580.4424_at_ctfanxnfba.unjnvvnaryrpgevp.arg>



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_at_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. Received on Fri Feb 06 2009 - 14:55:51 CST

Original text of this message