Refresh

This website www.w3schools.blog/sqlcode-function-oracle is currently offline. Cloudflare\'s Always Online™ shows a snapshot of this web page from the Internet Archive\'s Wayback Machine. To check for the live version, click Refresh.

SQLCODE function in Oracle

SQLCODE function is used within the Exception Handling section of a code. It is used to get the error number. Here, the error number is associated with the most recently raised error exception.

Syntax:

SQLCODE

Example:

EXCEPTION
WHEN OTHERS THEN
Raise_application_error (-20001, 'Error detected - '||SQLCODE||' -ERROR- '||SQLERRM);
END;