Re: How to print something in PL/SQL

From: Andy Finkenstadt <andy_at_homebase.vistachrome.com>
Date: Sat, 5 Sep 1992 00:50:31 GMT
Message-ID: <1992Sep5.005031.21099_at_homebase.vistachrome.com>


shamel_at_mais.hydro.qc.ca (Stephane Hamel) writes:
>When you use PL/SQL in SQL*Forms, you can show messages using the SQL*Forms
>MESSAGE() function.

This is because the PL/SQL engine runs INSIDE of SQL*forms 3.0, not on the database except when it has to access a database-inherent function such as a sequence, table, view, pseudocolumn (sysdate), and so on.

Because it runs WITHIN SQL*forms it has access to your keyboard and screen, just like Forms does. Additionally, forms adds a bunch of packages to the PL/SQL language (for example, MESSAGE() :-) ) which actually end up calling a SQL*Forms routine.

>I have built an SQL*Plus script, wich use in-line PL/SQL. My problem is that
>there is no way to print a message on the screen when you are inside the
>PL/SQL block!

Right. When you are in SQL*Plus, the PL/SQL is running on the DATABASE engine, not within SQL*plus. The "Database engine" has no access to your screen at all, nor are these predefined packages available to it.

> I wonder if someone have a solution for this. I can't understand
>why there is no ECHO, PRINT, TYPE, REMARK, COMMAND, MESSAGE or any such command
>that simply print-out a text string!

The solution, which only works if you can execute a standard.COMMIT statement, is to insert trace and other information in a table which you can view after the fact. This doesn't work if you need to ROLLBACK any of your work, since the trace info ends up rolled back, too. :(

>--
> Stephane Hamel (SHamel_at_Mais.Hydro.Qc.Ca)

Hope that helps a little. One of the things that CAN work is to use "SELECT 'I got to point3' INTO :variable FROM DUAL" within a Pro*C embedded PL/SQL block, you can use as many variables as you want to know how things are going.

-- 
Andrew Finkenstadt       | Vista-Chrome, Inc.   |           andy_at_GEnie
GEnie Unix Sysop/Manager | The Printing House   |    NIC Handle: AF136
+1 904 222 2639 home     | 1600 Capital Cir SW  |   ...!uunet!rde!andy
+1 904 575 0189 work     | Tallahassee FL 32310 | andy_at_vistachrome.com
--------->  "Our OS which art in CPU... UNIX be thy name"  <----------
Received on Sat Sep 05 1992 - 02:50:31 CEST

Original text of this message