Friday, October 2, 2009

FAQ : What is SQL Server PRINT equivalent in Oracle

Print In SQL Server
Returns a user-defined message to the client. Mainly Print is used while debugging procedures or triggers.
Eg
PRINT N'This is from first Loop.';

Oracle Equivalent :
What can come close in Oracle is DBMS_OUTPUT.PUT_LINE. Dbms_output is a PL/SQL Package which has a put_line procedure which write data to flat file or to direct your PL/SQL output to a screen.

DBMS_OUTPUT.PUT_LINE ('This is from first Loop);

1 comment:

Anonymous said...

Yeah, but if you just want to print a message in sqlplus, you can use the PROMPT command in any old SQL script:

SQL> PROMPT This is my message
This is my message
SQL>

 
Locations of visitors to this page