-
1. Re: catch exception in procedure FOR EACH ROW
shawkins Apr 8, 2013 5:49 PM (in response to jane_lj)What do you need more information about - a source or a Teiid exception? Teiid 8.2+ with https://issues.jboss.org/browse/TEIID-1386 supports exception handling. See https://docs.jboss.org/author/display/TEIID/Procedure+Language
Steve
-
2. Re: catch exception in procedure FOR EACH ROW
jane_lj Apr 15, 2013 9:22 AM (in response to shawkins)Thank you, Steve.
I followed the link you mentioned, and wrote this exception handling in my procedure, but always got syntax errors:
FOR EACH ROW
BEGIN ATOMIC
DECLARE integer x;
DECLARE EXCEPTION e;
INSERT INTO SM.table1 (...) VALUES (...);
VARIABLES.x = (SELECT COUNT(column1I) FROM SM.table1);
IF (x <= 0) THEN
RAISE e;
END IF
END
I got this error:
ERROR: TEIID31100 Parsing error: Encountered "<= 0) [*]THEN[*] RAISE e" at line 8, column 17.
Was expecting: "alter" | "begin" | "break" | "call" | "continue" | "create" | "declare" | "delete" | "drop" | "error" ...
Tried so many things, can't fix this error. Do you know where is wrong?
And where can I find the Teiid syntax of exception handling and the Teiid predefined exception, like NO_DATA_FOUND?
Thanks a lot!
-
3. Re: catch exception in procedure FOR EACH ROW
shawkins Apr 15, 2013 9:42 AM (in response to jane_lj)THEN is not used in an if statement. Did you see an errant example somewhere? Otherwise you should follow the Reference and you can always just check the grammar - https://docs.jboss.org/author/display/TEIID/BNF+for+SQL+Grammar#BNFforSQLGrammar-ifStatement
Steve