Re: How to print something in PL/SQL

From: <dlm_at_hermes.dlogics.com>
Date: 9 Sep 92 10:17:53 CST
Message-ID: <1992Sep9.101753.1308_at_hermes.dlogics.com>


In article <1992Sep7.100426.353_at_hhcs.gov.au>, pihlab_at_hhcs.gov.au writes:

>> Oracle, in their infinite wisdom, has deemed it appropriate that PL/SQL
>> have no native print utilities.  A rather hideous means of "printing"
>> is to write results to a table and then print them out with a select
>> statement following the PL/SQL script.  But this is horrible (and costly
>> in terms of extra database access) alternative to a print statement.

>
> I've been toying with the idea that SQL*Connect could be used to write output
> from within PL/SQL but you would have to define a "table" to SQL*Connect that
> is really an OS output stream. Unfortunately, we don't have SQL*Connect/RMS
> here so I can't play with it.
>
In version 7, oracle offers packaged procedures called debug_io which resemble "c" print statements. This is a cosmetic improvement, for internally, the procedures write to tables. Furthermore, in v7 sqlplus you can declare pl/sql variables which are bound to your dml statements. you can examine the scalar values in much the same way as defined &symbols.

No matter what you do, the kernel has no choice but to write to structures available to it. One item nobody has considered is the session trace file. Could the kernel be seduced to put debug messages there?

--
Dave Mausner, Senior Consultant / Datalogics Inc / Chicago IL / 312-266-4450
dlm_at_dlogics.com                                 Motto: Just show me the code
Received on Wed Sep 09 1992 - 18:17:53 CEST

Original text of this message