Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Table of Contents

Overview 

When handling user-defined exceptions, the error code in Altibase is always 201232, which can be verified by
checking the value of SQLCODE.

Whereas, in case of the ORACLE, it is 1.

ORACLE

Code Block
CREATE OR REPLACE PROCEDURE PROC1
AS
	E1 EXCEPTION;
BEGIN
	RAISE E1;

	EXCEPTION
	WHEN E1 THEN

	DBMS_OUTPUT.PUT_LINE('SQLCODE: ' || SQLCODE);
	DBMS_OUTPUT.PUT_LINE('SQLERRM: ' || SQLERRM);

END;
/

Procedure created.

SQL> EXEC PROC1;
SQLCODE: 1
SQLERRM: User-Defined Exception

PL/SQL procedure successfully completed.


ALTIBASE HDB

Code Block
CREATE OR REPLACE PROCEDURE PROC1
AS
	E1 EXCEPTION;
BEGIN
	RAISE E1;

	EXCEPTION
	WHEN E1 THEN

	SYSTEM_.PRINTLN('SQLCODE: ' || SQLCODE);
	SYSTEM_.PRINTLN('SQLERRM: ' || SQLERRM);

END;
/
Create success.
iSQL> EXEC PROC1;
SQLCODE: 201232
SQLERRM: User-Defined Exception.
Execute success.