Re: Issues with writing to server-side log file.

From: seannakasone <snakason_at_flex.com>
Date: Fri, 6 Feb 2009 12:03:57 -1000
Message-ID: <Pine.CYG.4.58.0902061201500.4576_at_ctfanxnfba.unjnvvnaryrpgevp.arg>



Thanks it worked.

It needed to be in quotes and uppercase.

BTW, do you know how to show existing directory objects?

On Fri, 6 Feb 2009, seannakasone wrote:

> 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 - 16:03:57 CST

Original text of this message