Error Log function and exception. PLS-00201

I’m trying to create an error log table that displays package name, function name, error message, and a timestamp.

EXCEPTION

WHEN OTHERS THEN
ERROR_MSG := SUBSTR(SQLERRM, 1, 100);

INSERT INTO ERROR_LOG (PACKAGE_NAME, FUNCTION_NAME, ERROR_MESSAGE, ERROR_TIMESTAMP, USER_ID)
VALUES (‘USER_PKG’, ‘INSERT_FUNCT’, ERROR_MSG, CURRENT_TIMESTAMP);

It’s saying ERROR_MSG must be declared by I’m not sure how to do that

Error_msg error_log.error_message%type;

Should do the trick. In the declare section or above the begin if it's a procedure or function.

Cheers,

Norm [ TeamT ]

On 5 December 2014 17:10:37 GMT+00:00, "tyler.beets" bounce-tylerbeets@toadworld.com wrote:

Error Log function and exception. PLS-00201

Thread created by tyler.beets
I'm trying to create an error log table that displays package name, function name, error message, and a timestamp.

EXCEPTION

WHEN OTHERS THEN
ERROR_MSG := SUBSTR(SQLERRM, 1, 100);

INSERT INTO ERROR_LOG (PACKAGE_NAME, FUNCTION_NAME, ERROR_MESSAGE, ERROR_TIMESTAMP, USER_ID)
VALUES ('USER_PKG', 'INSERT_FUNCT', ERROR_MSG, CURRENT_TIMESTAMP);

It's saying ERROR_MSG must be declared by I'm not sure how to do that

To reply, please reply-all to this email.

Stop receiving emails on this subject.

Or Unsubscribe from Oracle notifications altogether.

Toad World - Oracle Discussion Forum

Flag this post as spam/abuse.

--

Sent from my Android device with K-9 Mail. Please excuse my brevity.