Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> Re: Results of Dynamic SQL to a Flat File
Hi there,
This might be a simple solution... You might want to store the information into a table and simply use SQL PLUS to spool the information to a flat file...
Ciao,
P
StackFault_at_rocketmail.com wrote:
>
> I need suggestions on how to execute a SQL query that is dynamically
> created by a stored procedure so that I can get the output into a text
> file for transmision to a mainframe. I'm using Oracle 7.2 over UNIX on a
> DEC Alpha midrange. (Note: UTL_FILE is not available in 7.2)
>
> Our SQL is quite long (over 32K in some cases) and complex as it's used
> for financial reports. Our existing stored procedure that dynamically
> creates the SQL returns it to my new procedure, but I don't know how to
> then run it so that I can see the results (which I could then spool to a
> file). The DBMS package for dynamic SQL seems to only work with DDL and
> DML, not queries. We've tried using PUT_LINE to spool the SQL out, in
> small pieces, to a file that could then be executed from SQL*Plus, but
> the SQL's full of imbedded blanks in the resulting file.
>
> This would think that this is a fairly commong problem. Any suggestions
> would be geatly appreciated.
>
> Mike
> StackFault_at_rocketmail.com
>
> -------------------==== Posted via Deja News ====-----------------------
> http://www.dejanews.com/ Search, Read, Post to Usenet
Received on Tue Jan 13 1998 - 00:00:00 CST