Updated on 2024-09-30 GMT+08:00

DBMS_OUTPUT

Related Interfaces

Table 1 provides all interfaces supported by the DBMS_OUTPUT package.

Table 1 DBMS_OUTPUT

API

Description

DBMS_OUTPUT.PUT_LINE

Outputs the specified text. The text length cannot exceed 32,767 bytes.

DBMS_OUTPUT.PUT

Outputs the specified text to the front of the specified text without adding a line break. The text length cannot exceed 32,767 bytes.

DBMS_OUTPUT.ENABLE

Sets the buffer area size. If this interface is not specified, the maximum buffer size is 20,000 bytes and the minimum buffer size is 2000 bytes. If the specified buffer size is less than 2000 bytes, the default minimum buffer size is applied.

  • DBMS_OUTPUT.PUT_LINE

The PUT_LINE procedure writes a row of text carrying a line end symbol in the buffer. The DBMS_OUTPUT.PUT_LINE function prototype is:

1
2
DBMS_OUTPUT.PUT_LINE (
item IN VARCHAR2);
Table 2 DBMS_OUTPUT.PUT_LINE interface parameters

Parameter

Description

item

Specifies the text that was written to the buffer.

  • DBMS_OUTPUT.PUT

The stored procedure PUT outputs the specified text to the front of the specified text without adding a linefeed. The DBMS_OUTPUT.PUT function prototype is:

1
2
DBMS_OUTPUT.PUT (
item IN VARCHAR2);
Table 3 DBMS_OUTPUT.PUT interface parameters

Parameter

Description

item

Specifies the text that was written to the specified text.

  • DBMS_OUTPUT.ENABLE

The stored procedure ENABLE sets the output buffer size. If the size is not specified, it contains a maximum of 20,000 bytes. The DBMS_OUTPUT.ENABLE function prototype is:

1
2
DBMS_OUTPUT.ENABLE (
buf IN INTEGER);
Table 4 DBMS_OUTPUT.ENABLE interface parameters

Parameter

Description

buf

Sets the buffer area size.

Examples

1
2
3
4
5
6
BEGIN
    DBMS_OUTPUT.ENABLE(50);
    DBMS_OUTPUT.PUT ('hello, ');
    DBMS_OUTPUT.PUT_LINE('database!');-- Displaying "hello, database!"
END;
/