Welcome to plsql4all.blogspot.com SQL, MYSQL, ORACLE, TERADATA, MONGODB, MARIADB, GREENPLUM, DB2, POSTGRESQL.

Wednesday 6 August 2014

DBMS_OUTPUT.PUT_LINE in Oracle

Dbms_output.put_line package:-

Dbms_output.put_line, oracle supplied package is use to show a message by programmer if they (programmer) wants to show any output.

While using this package in named pl/sql block, you need to make sure that you have set the parameter SERVEROUTPUT as ON like shown below:-

SET SERVEROUTPUT ON;

It will be helpful to you when you want to show any message to the users. Let’s look at the below example to understand this easily:-

Let’s try to show any message on the screen by executing below program:-


It clearly show procedure successfully completed but does not show any values. Why? No error and no output as well. Here serveroutput parameter comes to existence. If you want to see message you must set serveroutput on then try to execute the same program:-


When we have set serveroutput on and executed same code it displays message. So always remember that whenever you use pl/sql you must set serveroutput as on.




Read Also:-   

No comments:

Post a Comment

Please provide your feedback in the comments section above. Please don't forget to follow.