Re: Printing Text in PL/SQL
Date: 1996/01/23
Message-ID: <4e1c6r$5i2_at_njala.saga.is>#1/1
>In <4d0f2t$ra7_at_sunti1.sdm.de>, rest_at_sdm.de (Johannes Rest) writes:
>>i'm having difficulties in printing text in PL/SQL. In my current
>>project i have to use an PL/SQL-Procedure within an ordinary SQL-Script.
>>The PL/SQL Procedure calls an stored procedure, in which error messages
>>are generated. Now i need to print out these messages in an log-file.
mlanda_at_vnet.ibm.com wrote:
>You could: 1) Create a table to store your error msgs and
> do an insert or
This will not work if he gets an exception in his pl/sql package, the
exception means that the transaction is rolled back and so is any
insert in an error table.
> 2) Use Dbms_Output.Put_Line(...) in your procedures and
> Spool the buffer to a file.
> For example:
> set serveroutput on
> spool chkmsg
> _at_scriptname.sql
> spool off
But what if his pl/sql package is not used from sqlplus, but say from a trigger or a forms application etc?
The only solution is to write a service program that uses dbms_pipe to do the text io work. I did that as a part of larger project to solve exactly these problems.
A text_io package will be available in oracle 7.2 or 7.3, I belive.
-- kjartang_at_ejs.isReceived on Tue Jan 23 1996 - 00:00:00 CET
>M.Landa