# How to get error message in Oracle stored procedure?

You can retrieve the error code with the PL/SQL function SQLCODE , described in "SQLCODE Function". This function returns a maximum of 512 bytes, which is the maximum length of an Oracle Database error message (including the error code, nested messages, and message inserts such as table and column names).

Bron: [Retrieving Error Code and Error Message - Oracle Help Center](https://docs.oracle.com/en/database/oracle/oracle-database/26/lnpls/retrieving-error-code-and-error-message.html#:~:text=You%20can%20retrieve%20the%20error,described%20in%20%22SQLCODE%20Function%22.&text=This%20function%20returns%20a%20maximum,as%20table%20and%20column%20names).)

Toegevoegd: 2026-01-26
Webpagina: https://1001vragen.nl/vraag/how-to-get-error-message-in-oracle-stored-procedure

## How to get the error message in Oracle?

You can retrieve the error code with the PL/SQL function SQLCODE , described in "SQLCODE Function". This function returns a maximum of 512 bytes, which is the maximum length of an Oracle Database error message (including the error code, nested messages, and message inserts such as table and column names).

Bron: [Retrieving Error Code and Error Message - Oracle Help Center](https://docs.oracle.com/en/database/oracle/oracle-database/26/lnpls/retrieving-error-code-and-error-message.html#:~:text=You%20can%20retrieve%20the%20error,described%20in%20%22SQLCODE%20Function%22.&text=This%20function%20returns%20a%20maximum,as%20table%20and%20column%20names).)

## How to show errors in Oracle procedure?

After you use the CREATE command to create a stored procedure, a message is displayed if the stored procedure has any compilation errors. To see the errors, you use SHOW ERRORS. When you specify SHOW ERRORS with no arguments, SQL*Plus shows compilation errors for the most recently created or altered stored procedure.

Bron: [SHOW - Oracle Help Center](https://docs.oracle.com/en/database/oracle/oracle-database/26/sqpug/SHOW.html#:~:text=After%20you%20use%20the%20CREATE,created%20or%20altered%20stored%20procedure.)

## How to get error message in SQL?

Use TRY/CATCH to handle an error up_GetProductSizeInInches 710, @SizeInInches OUTPUT; SELECT @SizeInInches; Review the results, which show the size as 0. Then review the output messages and note that they include a notification that an error occurred.

Bron: [Implement error handling with Transact-SQL](https://microsoftlearning.github.io/dp-080-Transact-SQL/Instructions/Labs/12-implement-error-handling.html#:~:text=Use%20TRY%2FCATCH%20to%20handle%20an%20error,-Transact%2DSQL%20supports&text=int%3B%20EXECUTE%20SalesLT.-,up_GetProductSizeInInches%20710%2C%20%40SizeInInches%20OUTPUT%3B%20SELECT%20%40SizeInInches%3B,notification%20that%20an%20error%20occurred.)

## How do I view error logs in Oracle?

From the Utilities drop-down menu, go to Logs > View Error Log. To search for error logs based on pre-defined or custom date ranges, in the Search Conditions section, enter a value, and click Search. The search results appears in the Total Number of Rows section.

Bron: [View the Error Log - Oracle Help Center](https://docs.oracle.com/en/industries/health-sciences/argus-safety/8.2.2/aadmn/view-error-log.html#:~:text=From%20the%20Utilities%20drop%2Ddown,Total%20Number%20of%20Rows%20section.)

## Verwante vragen

- [How to solve this error in SQL?](https://1001vragen.nl/vraag/how-to-solve-this-error-in-sql.md)
- [What is error code 1073548784 in SQL Server?](https://1001vragen.nl/vraag/what-is-error-code-1073548784-in-sql-server.md)
- [What is error code Ora 01036?](https://1001vragen.nl/vraag/what-is-error-code-ora-01036.md)
- [How to solve ambiguous column name error in SQL?](https://1001vragen.nl/vraag/how-to-solve-ambiguous-column-name-error-in-sql.md)
- [How to resolve invalid number error in Oracle?](https://1001vragen.nl/vraag/how-to-resolve-invalid-number-error-in-oracle.md)
- [How to solve invalid identifier error in SQL?](https://1001vragen.nl/vraag/how-to-solve-invalid-identifier-error-in-sql.md)
- [What is error code 1062 in SQL state 23000?](https://1001vragen.nl/vraag/what-is-error-code-1062-in-sql-state-23000.md)
- [What is a synonym for trial and error?](https://1001vragen.nl/vraag/what-is-a-synonym-for-trial-and-error.md)
- [What is trial and error in research?](https://1001vragen.nl/vraag/what-is-trial-and-error-in-research.md)
- [What is an example of trial and error?](https://1001vragen.nl/vraag/what-is-an-example-of-trial-and-error.md)
