Quantcast
Channel: SCN: Message List - SAP HANA Developer Center
Viewing all articles
Browse latest Browse all 9165

Re: Exit command in SQL script

$
0
0

Hi Arpita,

 

If you run the following procedure, you'll get an exception as expected.

 

If you uncomment the two commented lines, you'll see that the exception is handled and that a value is stored in a scalar output variable.

 

Let me know if this helps.

 

Cheers,

Jody

 

DROP PROCEDURE TESTP;
CREATE PROCEDURE TESTP(OUT a INTEGER) AS

BEGIN
DECLARE MYCOND CONDITION FOR SQL_ERROR_CODE 10001;

-- DECLARE EXIT HANDLER FOR SQLEXCEPTION
-- SELECT 5 INTO a FROM DUMMY;

SIGNAL MYCOND SET MESSAGE_TEXT = 'Enter a message here';
END;

CALL TESTP(?);


Viewing all articles
Browse latest Browse all 9165

Trending Articles