[teiid-issues] [JBoss JIRA] (TEIID-1386) Support exception handling in the procedures

Steven Hawkins (JIRA) jira-events at lists.jboss.org
Mon Sep 24 11:37:35 EDT 2012


    [ https://issues.jboss.org/browse/TEIID-1386?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12721047#comment-12721047 ] 

Steven Hawkins commented on TEIID-1386:
---------------------------------------

we now support a raise statement:

{code}RAISE e;{code}

where e can be a variable reference to an exception or an exception expression: 

{code}(SQLEXCEPTION|SQLWARNING) msg [SQLSTATE state [, errCode]] EXCEPTION e{code}

where msg is a string expression of the message, state is a string expression of the SQLState, errCode is an integer expression of the error/vendor code, and e is a variable reference to an exception or an exception expression of the parent/nested exception.

i.e. {code}RAISE SQLEXCEPTION 'error' SQLSTATE 'abc'{code} 

The error statement {code}ERROR 'blah';{code}

is still accepted, but is parsed as {code}RAISE SQLEXCEPTION 'blah'{code}

When a warning is raised, it will be attached to the CommandContext and returned to the client, but it will not cause the current block to exit.

There were also corrections made to the handling of sqlstate/error code in the TeiidSQLException to ensure proper values are reported to clients.
                
> Support exception handling in the procedures
> --------------------------------------------
>
>                 Key: TEIID-1386
>                 URL: https://issues.jboss.org/browse/TEIID-1386
>             Project: Teiid
>          Issue Type: Feature Request
>          Components: Query Engine
>    Affects Versions: 7.2
>            Reporter: Ramesh Reddy
>            Assignee: Steven Hawkins
>            Priority: Critical
>             Fix For: 8.2
>
>
> Currently the in Teiid procedure language there is no exception handling logic. For example if a INSERT fails due to unique key constraint, there is no way to catch that and do some other operation. Currently the procedure will exit the procedure will error. 

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira


More information about the teiid-issues mailing list