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:
DBMS_OUTPUT.PUT_LINE('My name is John')；
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.