|
||
Lesson 6
|
Using DBMS_OUTPUT.PUT_LINE | |
|
Objective
|
Use the DBMS_OUTPUT.PUT_LINE package procedure. | |
|
You can display the value from your PL/SQL
block with the DBMS_OUTPUT.PUT_LINE package procedure.
DBMS_OUTPUT is an Oracle-supplied package, and PUT_LINE is a procedure within that package. |
||
|
To enable the DBMS_OUTPUT package in your SQL*PLUS screen, you must execute the
SET
SERVEROUTPUT ON command.
|
||
|
Within a PL/SQL block, you can reference DBMS_OUTPUT.PUT_LINE and, in parentheses, provide the information you want to print to the
screen. The information you put in the parentheses must be a string value.
|
||
SET SERVEROUTPUT ON DECLARE BEGIN DBMS_OUTPUT.PUT_LINE (string value that needs to be displayed on the screen) END; |
||
|
The declaration of a host variable and referencing it within your PL/SQL block has been discussed.
Take a look at the following link to understand exactly how to accept the price of a pet and display the price on the screen. Values Sql Plus Screen |
||
| In the next lesson, the importance of naming conventions will be discussed. | ||
|
Oracle Naming Conventions Exercise
Click the Exercise button to use bind and host variables in a simulation.
Oracle Naming Conventions Exercise |
||
|
|
||