Re: HELP: Output from within Stored Procedure???

From: Ken Childress <kchildre_at_uccs.jpl.nasa.gov>
Date: 1996/05/07
Message-ID: <4mo7nn$k6h_at_netline-fddi.jpl.nasa.gov>#1/1


In article <4mo42f$j0o_at_netline-fddi.jpl.nasa.gov>, Ken Childress <kchildre_at_uccs.jpl.nasa.gov> wrote:
>I apologize in advance if this question is addressed in a FAQ somewhere.
>I am an Oracle newbie and under a deadline, so I need to find an answer
>as quickly as possible.
>
>I am trying to write some stored procedures to do various queries and
>output the results, via STDOUT, so they can be parsed by a PERL script.
>
>I want to do something similar to the following:
>
>create procedure display_user (social_security_no char) as
> user_rec user_accounts%rowtype;
>begin
> select * into user_rec from user_accounts where ssn = social_security_no ;
> printf ("User Name = %s\n", user_rec.user_name);
> printf ("SSN = %s\n", user_rec.ssn);
> ...
>end;
>
>
>The problem is, I can't find the any statements in SQLPLUS that will
>allow me to output to to STDOUT. I can use SQL queries invoked via
>shell scripts that do the select, but in our application many queries
>are needed and it is quite slow that way.
>
>Any suggestions?

Further poking around has allowed me to answer my question. For those interested in the answer, the package DBMS_OUTPUT contains the procedures needed to accomplish the task.

I don't know where that package is documented, but I found an example in the code from the book _Oracle PL/SQL Programming_ that is downloadable from http://www.osborne.com/oracle/ora12.htm.

Ken Received on Tue May 07 1996 - 00:00:00 CEST

Original text of this message