db-derby-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Patrice Drolet <pdro...@infodata.ca>
Subject How to access the record in a java method call by a trigger
Date Fri, 05 Aug 2005 11:47:37 GMT
Hi,

I need to call a java method from a trigger that will access the 
record.  The examples I saw shows only sql (select or updates) that can 
use external methods (with values ()). This is ok for some needs but the 
called method needs a reference to the row being modified. Here is how I 
see it:

create trigger fooTrig after insert on foo referencing NEW as N for each 
row mode db2sql values myIncTable(N);

But it does not work because this returns an error:

create function myIncTable(rs java.sql.ResultSet) language java 
parameter style java modifies sql external name  
'ca.infodata.derby.medoffice.triggers.LesTriggers.myIncTable';

I see 2 problems here: it seems that only functions can be used in a 
trigger but functions can not use MODIFIES SQL (I need the called 
trigger method to do inserts in different tables and it cannot be done 
by adding other triggers). And the function creation does not seem to 
accept a ResultSet parameter.

Is there any solution to this problem?

Regards,

Patrice Drolet
Logiciels INFO-DATA inc.


Mime
View raw message