db-derby-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Thomas Hill <thomas.k.h...@t-online.de>
Subject Re: trigger calling a procedure
Date Tue, 23 Oct 2012 21:21:18 GMT
Rick Hillegas <rick.hillegas@...> writes:

> 
> On 10/21/12 11:45 PM, Thomas Hill wrote:
> > CREATE TRIGGER "TR_XY"
> >    AFTER INSERT
> >    ON "TBL_XY"
> >    FOR EACH ROW
> >    CALL PROCEDURE "SP_xy"('xyz', 0);
> Hi Thomas,
> 
> That's almost correct. If you remove the keyword PROCEDURE from the 
> triggered statement, then it will be a valid SQL statement. The 
> following would work:
> 
> CREATE TRIGGER "TR_XY"
>    AFTER INSERT
>    ON "TBL_XY"
>    FOR EACH ROW
>    CALL "SP_xy"('xyz', 0);
> 
> Hope this helps,
> -Rick
> 
> 

thanks for that! working now.

Next challenge for me is to figure out if and how the NEW values can be read and
stored in a variable in the java code? 

Tried 

int i = NEW."RowID"; 

to store the new value of column "RowID" in a variable, but the java compiler
already complains about that (NEW cannot be resolved to a type / class <NEW>
cannot be resolved to a type / syntax error on token "RowID" : class expected)

Many thanks
Thomas









Mime
View raw message