You are viewing a plain text version of this content. The canonical link for it is here.
Posted to derby-dev@db.apache.org by "Thomas Nielsen (JIRA)" <ji...@apache.org> on 2007/11/21 15:10:43 UTC

[jira] Commented: (DERBY-3220) (ReferencingClause) in CREATE TRIGGER statement not SQL compliant

    [ https://issues.apache.org/jira/browse/DERBY-3220?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12544471 ] 

Thomas Nielsen commented on DERBY-3220:
---------------------------------------

Patch looks ok, and seems to work as expected.

ij> CREATE TRIGGER TrigC AFTER INSERT ON tablea REFERENCING NEW  ROW AS N FOR EACH ROW
>  UPDATE tableb SET tagcount=(tagcount-1) where tagid=n.id;
0 rows inserted/updated/deleted

I haven't run suites.All nor derbyAll, but I would expect you need some explicit tests for the corrected syntax as well?


> <transition table or variable list> (ReferencingClause) in CREATE TRIGGER statement not SQL compliant
> -----------------------------------------------------------------------------------------------------
>
>                 Key: DERBY-3220
>                 URL: https://issues.apache.org/jira/browse/DERBY-3220
>             Project: Derby
>          Issue Type: Bug
>          Components: SQL
>            Reporter: Bernt M. Johnsen
>            Assignee: Bernt M. Johnsen
>            Priority: Minor
>         Attachments: DERBY-3220.diff
>
>
> Derby implements the following syntax:
> REFERENCING
> {
> { OLD | NEW } [ AS ] correlation-Name [ { OLD | NEW } [ AS ] correlation-Name ] | 
> { OLD_TABLE | NEW_TABLE } [ AS ] Identifier [ { OLD_TABLE | NEW_TABLE }
> [AS] Identifier ] 
> }
> The SQL standard specifies:
> <trigger definition> ::=
> CREATE TRIGGER <trigger name> <trigger action time> <trigger event>
> ON <table name> [ REFERENCING <transition table or variable list> ]
> <triggered action>
> .......
> <transition table or variable> ::=
> OLD [ ROW ] [ AS ] <old transition variable name>
> | NEW [ ROW ] [ AS ] <new transition variable name>
> | OLD TABLE [ AS ] <old transition table name>
> | NEW TABLE [ AS ] <new transition table name>

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.