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
In article <884642437.133496842_at_dejanews.com>,
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.
Thank you for the many e-mail responses I received to this question. They gave me an idea for a very simple solution that seems to work:
My new stored procedure calls my existing one that returns a select statement into a variable. To the beginning of this string, I add "Create or replace view temp_view as " and then execute this statement with DBMS_SQL dynamic SQL funcitons. I then open a spool file and select * from temp_view. (The execute and the select statement are actually run from a UNIX shell script in my case.)
Hope this can help someone else and thanks again.
Mike
-------------------==== Posted via Deja News ====----------------------- http://www.dejanews.com/ Search, Read, Post to UsenetReceived on Tue Jan 13 1998 - 00:00:00 CST