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: DBMS_OUTPUT and ODBC

Re: DBMS_OUTPUT and ODBC

From: Chris Halioris <halioris_chris_nonlilly_at_lilly.com>
Date: 1997/02/10
Message-ID: <32FF8B7B.2831@lilly.com>#1/1

jon glickman wrote:
>
> Does anybody have any experience in how to get around the
> DBMS_OUTPUT.PUTLINE( ... ) function from a stored procedure
> or a cursor in a ODBC call. In sqldba or sql*plus one would
> first
>
> sql> set server output on
> sql>
>
> how does one do the same in a ODBC call to the database,
> my curses and stored procedures work but I can't get them
> to display anything from the DBMS_OUTPUT statement?
>
> jglickma_at_lynx.neu.edu

Sorry, can't tell you how to get DBMS_OUTPUT.PUT_LINE to work via ODBC but can offer an alternative that may work for you. Write your own procedure as follows:

CREATE OR REPLACE PROCEDURE my_put_line(p_string IN VARCHAR2) IS BEGIN
   INSERT INTO output_table (line, txt)
   VALUES (line_seq.nextval, p_string);
END; This assumes you have created a table named output_table and a sequence named line_seq. You can then call this procedure instead of dbms_output.put_line and all output will be written to a table which you can select at the end of the process (order by line). You may want to include commit's at some point depending on your procedure. If multiple people may be using the procedure at the same time you may also want to include a sessionid in the table. And don't forget to delete the records when you're done.

It's certainly more work than you'd like to undertake, but it could be a last option if you can't figure out how to get DBMS_OUTPUT to work over ODBC. Chris Halioris
Tactics, Inc. Received on Mon Feb 10 1997 - 00:00:00 CST

Original text of this message

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