Robbin Rod
Robbin Rod

Reputation: 19

ORA-00972: identifier is too long-how to catch this error in exception

how to trap this error

'ORA-00972: identifier is too long' in the exception section

in oracle pl/sql,

could you please give me example

Upvotes: 1

Views: 1324

Answers (1)

The way to trap any exception is to initialize an EXCEPTION variable with the proper exception number (-972 in this case) and then use it in an EXCEPTION block:

DECLARE
  excpIdentifier_too_long  EXCEPTION;
  PRAGMA EXCEPTION_INIT(excpIdentifier_too_long, -972);
BEGIN
  NULL;  -- whatever
EXCEPTION
  WHEN excpIdentifier_too_long THEN
    DBMS_OUTPUT.PUT_LINE('Do something useful here');
END;

Best of luck.

Upvotes: 2

Related Questions