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: Is there a way I can direct a output of select statement (in a stored procedure) into a file?

Re: Is there a way I can direct a output of select statement (in a stored procedure) into a file?

From: Neil Cudd <neil_at_cudd.demon.co.uk>
Date: Fri, 3 Sep 1999 16:22:02 +0100
Message-ID: <936372251.17306.0.nnrp-04.c2de6f3d@news.demon.co.uk>


Just as a suggestion that is not the same as these other fine fellows :

I had a problem trying to dynamically generate shell scripts from within a PL/SQL and eventually I had to create a table, definition :

script_line        Varchar(80)
seq_no            number

from within the PL/SQL, insert each line that you want in the resulting file into the table first together with the incrementing sequence number. Then simply spool the results of "select script_line from table order by seq_no" from sqlplus (after set heading off, set pages 0 etc). The result was quite a complex output file and I am convinced I could not have done it using the UTL_FILE package ..... but I could be wrong.

hth neil

pcmwong_at_my-deja.com wrote in message <7qn1pm$b6j$1_at_nnrp1.deja.com>...
>Hi All,
>
>Is there a way I can direct a output of select statement (in a stored
>procedure) into a file?
>
>I know I can use spool command to direct the output into a file under
>SQL Plus or SQL Plus Worksheet.
>
>How about in a stored procedure of a database?
>
>Please help.
>
>Thanks a lot for your input.
>
>Yours Truly,
>
>Paul
>
>
>Sent via Deja.com http://www.deja.com/
>Share what you know. Learn what you don't.
Received on Fri Sep 03 1999 - 10:22:02 CDT

Original text of this message

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