Re: PL/SQL UTL_FILE PACKAGE
Date: 1998/01/27
Message-ID: <01bd2b57$ea3eb850$8859a8c0_at_04653>#1/1
Hello,
The 1st error (pls-00221) is because you're not providing a variable to accept the value returned by the function. All functions must be invoked in an assignment statement e.g. var_foo := some_function(); Your invocation implies a procedure hence the message text. Note that the fopen function returns a "file_type" value that is defined in utl_file so when you declare your variable you'll need to use "type" reference to it.
The second error is simply syntax on your attempt to declare the function. This is not necessary.
Special note: Your example implies a local drive. If in fact you are client server please know that this package (utl_file) is specific to server side I/O. Also, note that the DBA must identify accessable directories to be referenced with utl_file.
Good luck.
Ken F.
thierry merlin <t.merlin_at_citb.bull.net> wrote in article
<01bd264b$ff767d40$3c4c5ac0_at_thierry.citb.bull.net>...
> Hi,
> I'm not an expert in PL/SQL.
> So, I want to use UTL_FILE package but somme errors appears :
>
> UTL_FILE.FOPEN('c:\tmp','tit.txt','r');
> *
> ERREUR à la ligne 3:
> ORA-06550: Ligne 3, colonne 2:
> PLS-00221: 'FOPEN' n'est pas une procédure ou est indéfini
> ORA-06550: Ligne 3, colonne 2:
> PL/SQL: Statement ignored
>
> I know that FOPEN is a function but if I write :
> DECLARE
> FUNCTION FOPEN(...)RETURN UTL_FILE.FILE_TYPE;
> *
> ORA-06550: Ligne 2, colonne 10:
> PLS-00328: Un corps sous-programme doit être défini pour la déclaration
de
> réexpédition de FOPEN.
> ORA-06550: Ligne 4, colonne 2:
> PLS-00221: 'FOPEN' n'est pas une procédure ou est indéfini
> ORA-06550: Ligne 4, colonne 2:
> PL/SQL: Statement ignored
>
> I write and launch my sample.sql under SQL*PLUS like SQL> start
sample.sql
> .
> Someone know how to use this package and can give me some samples.
> Thank's for your help!
>
>
Received on Tue Jan 27 1998 - 00:00:00 CET