|Lesson 6||Using DBMS_OUTPUT.PUT_LINE|
|Objective||Use the DBMS_OUTPUT.PUT_LINE Package Procedure |
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
package in your SQL*PLUS screen, you must execute the
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
DBMS_OUTPUT.PUT_LINE (string value that needs to be
displayed on the screen)
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