on 05-18-2018 5:12 AM
I've got an AMDP class (for Planning Function, namely) with SQLScript method executing some logic. Because an SQL exception may occur there, I declared an exit handler:
METHOD my_hana_procedure BY DATABASE PROCEDURE FOR HDB LANGUAGE SQLSCRIPT
OPTIONS READ-ONLY.
.....
DECLARE EXIT HANDLER FOR SQLEXCEPTION begin
e_msg = select 'ZIP' as msgid,
'E' as msgty,
'000' as msgno,
::SQL_ERROR_CODE as msgv1,
left( ::SQL_ERROR_MESSAGE,50) as msgv2,
substr( ::SQL_ERROR_MESSAGE, 51, 50) as msgv3,
substr( ::SQL_ERROR_MESSAGE, 101, 50) as msgv4
from dummy;
end;
.....
e_msg = select 'ZIP' as msgid,
'I' as msgty,
'000' as msgno,
'Successful execution' as msgv1,
'' as msgv2,
'' as msgv3,
'' as msgv4
from dummy;
ENDMETHOD.
Then I try to execute my Planning Function from RSPLAN:
1. If I put a breakpoint into this SQLScript based method (in Eclipse), I get to debug, and I see that the exit handler code gets executed (however, _after_ all other code of my_hana_procedure). Then I see an error message in RSPLAN with msgv1-4 populated.
2. If I disable SQLScript debugger in Eclipse, the function is executed and I see "Successful execution" message with green status, i.e. exit handler has not been engaged.
Question: Does it mean that exit handlers don't work in AMDP framework??
User | Count |
---|---|
75 | |
10 | |
8 | |
7 | |
6 | |
6 | |
5 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.