Dynamic SQL Output to a File in Forms

From: Ed & Deanna Jennings <jenningse_at_mindspring.com>
Date: 2000/08/09
Message-ID: <39919474.11B5586F_at_mindspring.com>#1/1


Forms 5.0.6.22
RDBMS 8.1.5 I have a button in Forms that needs to execute a query, and dump the result set into a CSV file. The where clause can change each time (it basically repeats the last query the user executed), thus I need to use dynamic SQL (i.e dbms_sql package). I then use the text_io package to write the file. This worked fine when the DB was 7.3.4, but now gives an error when using 8.1.5. In a nut shell, I do the following:

    dbms_sql.open_cursor
    dbms_sql.parse
    dbms_sql.define_column
    dbms_sql.fetch_rows
    dbms_sql.column_value
    text_io.put_line(values)
    dbms_sql.close_cursor

I'm not married to this approach, in fact I'd love an easier alternative. It has to be some form of dynamic SQL, and a cursor to process the multiple rows of output. The file needs to be written on the client workstation, so I've sort of eliminated a server side solution. Does anyone have any advice for me.

TIA
Ed Jennings

--
~~~~~~~~~~~~~~~~~~~~~~~~~
jenningse_at_mindspring.com
Received on Wed Aug 09 2000 - 00:00:00 CEST

Original text of this message