| Oracle9i Supplied PL/SQL Packages and Types Reference Release 1 (9.0.1) Part Number A89852-02 |
|
DBMS_OUTPUT , 4 of 6
You can either place an entire line of information into the buffer by calling PUT_LINE, or you can build a line of information piece by piece by making multiple calls to PUT. Both of these procedures are overloaded to accept items of type VARCHAR2, NUMBER, or DATE to place in the buffer.
All items are converted to VARCHAR2 as they are retrieved. If you pass an item of type NUMBER or DATE, then when that item is retrieved, it is formatted with TO_CHAR using the default format. If you want to use a different format, then you should pass in the item as VARCHAR2 and format it explicitly.
When you call PUT_LINE, the item that you specify is automatically followed by an end-of-line marker. If you make calls to PUT to build a line, then you must add your own end-of-line marker by calling NEW_LINE. GET_LINE and GET_LINES do not return lines that have not been terminated with a newline character.
If your line exceeds the buffer limit, then you receive an error message.
DBMS_OUTPUT.PUT (item IN NUMBER); DBMS_OUTPUT.PUT (item IN VARCHAR2); DBMS_OUTPUT.PUT (item IN DATE); DBMS_OUTPUT.PUT_LINE (item IN NUMBER); DBMS_OUTPUT.PUT_LINE (item IN VARCHAR2); DBMS_OUTPUT.PUT_LINE (item IN DATE); DBMS_OUTPUT.NEW_LINE;
| Parameter | Description |
|---|---|
a |
Item to buffer. |
| Error | Description |
|---|---|
ORA-20000, ORU-10027: |
Buffer overflow, limit of < |
ORA-20000, ORU-10028: |
Line length overflow, limit of 255 bytes per line. |
|
|
![]() Copyright © 1996-2001, Oracle Corporation. All Rights Reserved. |
|