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.

Reply via email to