December 2010
Intermediate to advanced
451 pages
11h 16m
English
You want to display query results at the SQL*Plus prompt.
Use the DBMS_OUTPUT package to assist in displaying query results or lines of text. The following example depicts both of these use cases:
DECLARE
first VARCHAR2(20);
last VARCHAR2(25);
BEGIN
SELECT first_name, last_name
INTO first, last
FROM employees
WHERE email = 'VJONES';
DBMS_OUTPUT.PUT_LINE('The following employee matches your query:');
DBMS_OUTPUT.PUT_LINE(first || ' ' || last);
END;
The previous example uses DBMS_OUTPUT.PUT_LINE to print a line of text as well as the values of the variables first and last.
The DBMS_OUTPUT package contains several useful procedures. ...
Read now
Unlock full access