DECLARE EXIT HANDLER FOR SQLEXCEPTION
SET p_proc_status= SQLCODE;
when i write this in proc it is show ing error as:SPL1027:E(L74), Missing/Invalid SQL statement'E(3707):Syntax error, expected something like a 'CONTINUE' keyword or an 'EXIT' keyword between the 'declare' keyword and the word 'CDC_CURSOR'.'.
problem : i should write condition such a way that when a procedure is stoped then it should show an exception why it stoped
It's not clear what you are asking. Some thoughts: