All Products
Search
Document Center

PolarDB:Errors and messages

Last Updated:Sep 25, 2024

You can use the DBMS_OUTPUT.PUT_LINE statement to report messages.

DBMS_OUTPUT.PUT_LINE ( message );

message is any expression evaluating to a string.

This example displays the message on the output display of the user:

BEGIN
    DBMS_OUTPUT.PUT_LINE('My name is John');
END;

The special variables SQLCODE and SQLERRM contain a numeric code and a text message that describe the outcome of the last SQL statement issued. If any other error occurs in the program such as division by zero, these variables contain information pertaining to the error.