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

Home -> Community -> Usenet -> c.d.o.misc -> Re: UTL_FILE - How do I call its funcs/procs form a stored proc

Re: UTL_FILE - How do I call its funcs/procs form a stored proc

From: Thomas Kyte <tkyte_at_us.oracle.com>
Date: Tue, 27 Oct 1998 15:44:11 GMT
Message-ID: <3637e9b3.6618637@192.86.155.100>


A copy of this was sent to "camicro" <camicro_at_nbnet.nb.can> (if that email address didn't require changing) On Tue, 27 Oct 1998 11:21:42 -0400, you wrote:

>I am writing a package that will create various flat ascii files but have
>been unsuccessful in my attempts to utilize oracles utl_file package to do
>my file i/o. example:
> handle :=sys.utl_file.fopen('/unixdirectory','flatfilename.dat','w')
>
>various errors occur regarding the handle declaration (I've tried various
>declarations - number,binary integer,char).
>
>Any suggestions would be greatly appreciated,
>Andrew Johnson
>camicro_at_nbnet.nb.ca
>
>

Well, fopen is defined as:

FUNCTION FOPEN(location IN VARCHAR2,

               filename IN VARCHAR2,
               open_mode IN VARCHAR2)

RETURN UTL_FILE.FILE_TYPE; so, a block of code (or proc/func) that wanted to use fopen would code:

declare

    l_output utl_file.file_type; begin

    l_output := utl_file.fopen( p_dir, p_fname, 'w' );     ....  

Thomas Kyte
tkyte_at_us.oracle.com
Oracle Government
Herndon VA

--
http://govt.us.oracle.com/ -- downloadable utilities  



Opinions are mine and do not necessarily reflect those of Oracle Corporation  

Anti-Anti Spam Msg: if you want an answer emailed to you, you have to make it easy to get email to you. Any bounced email will be treated the same way i treat SPAM-- I delete it. Received on Tue Oct 27 1998 - 09:44:11 CST

Original text of this message

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