Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: Problem with utl_file

Re: Problem with utl_file

From: Jurij Modic <jmodic_at_src.si>
Date: Tue, 08 Sep 1998 12:05:37 GMT
Message-ID: <35f51c4d.12126770@news.siol.net>


On Tue, 8 Sep 1998 13:30:45 +0200, "Ivan Bajon" <ib_at_ed.dk> wrote:

>I'm experimenting with file I/O from within PL/SQL. I try to run this in
>SQL*Plus
>
>declare
> type file_type is record (id binary_integer);
> myfile file_type;
>begin
> myfile := utl_file.fopen('C:\temp\','out.txt', 'w');
> utl_file.put_line(myfile, 'aaaa');
> utl_file.fclose(myfile);
>end;
>/
>
>but I get the line
>
>myfile := utl_file.fopen('C:\temp\','out.txt', 'w');
>
>and a ORA-06550 followed by PLS-00382 (invalid type) along with some
>additional errors. According to the documentation, I'm doing things right.
>Can anyone tell me what I do wrong? Oh, I better say that I am, of course,
>trying this on an Oracle7.3.

You must not declare a type "file_type" in your block - it is allready declared in the UTL_FILE package! So your declaration part should look like:

declare
-- type file_type is record (id binary_integer); THIS IS WRONG!

   myfile UTL_FILE.file_type;
begin
.....

>Thanks in advance
>- Ivan Bajon

HTH,
--
Jurij Modic <jmodic_at_src.si>
Certified Oracle7 DBA (OCP)



The above opinions are mine and do not represent any official standpoints of my employer Received on Tue Sep 08 1998 - 07:05:37 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US