Re: Redirecting output to stdoutusing Pro*C and SQL PL/SQL

From: Thomas J Kyte <tkyte_at_us.oracle.com>
Date: 1996/02/17
Message-ID: <4g3es1$i6a_at_inet-nntp-gw-1.us.oracle.com>#1/1


You will want to look at dbms_output.

In sql*plus try the following:

SQL> set serveroutput on size 100000
SQL> begin 
  2>   dbms_output.put_line( 'Hello World' );
  3> end;
  4> /

Hello World  

PL/SQL procedure successfully completed.

You can use dbms_output in any procedure you want. You can access the dbms_output stuff in a 3gl if you want by issueing a dbms_output.enable call, running the procedure and then calling dbms_output.get_line/get_lines.

This works in sql*plus, sqldba and svrmgrl.

surfer_at_I_should_put_my_domain_in_etc_NNTP_INEWS_DOMAIN (Alex Sharifi) wrote:

>I currently use embedded SQL in my C code to access the database,
>rerieve data using cursors, and then take the fetched data and store
>it in a C struct to be processed and displayed.
 

>I would like to know if there's a way to have a stored procedure
>display data to stdout, rather than using printf's in my code.
 

>Ex: I have a list of gizmos that I select into a cursor, and
>then I display the cursor contents using printfs etc....
>What I want is a "PRINT" command in SQL or PL/SQL which would
>print output to stdout, and not have to use host variables to
>get data and print them out in my C code.
 

>If anyone has any ideas I would appreciate them....Thank you...Alex Sharifi

Thomas Kyte
tkyte_at_us.oracle.com
Oracle Government



opinions and statements are mine and do not necessarily reflect the opinions of Oracle Corporation. Received on Sat Feb 17 1996 - 00:00:00 CET

Original text of this message