[Pljava-dev] Obtaining Query from Trigger

From: thhal at mailblocks(dot)com (Thomas Hallgren)
To:
Subject: [Pljava-dev] Obtaining Query from Trigger
Date: 2005-06-08 15:12:00
Message-ID: thhal-0Q6OCA3WAzjYeMnbS6hzr+s4Abguc8E@mailblocks.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pljava-dev

Joao Afonso wrote:

> If I have the following:
>
> - insert into user ("user_id", "name") values ('1','test')
>
> I want to pass the above string as a parameter to a Java function,
>because I might have to modify it and even pass the query to a
>different DB.
>
> In the case that this can not be done at all, I guess I could obtain
>the data that was inserted to the DB with a SELECT and then pass it to
>a java function?
>
> I'm sorry if I'm being a little vague on the subject, but like I
>said I'm new to pljava and these are just some ideas I need to test
>for a project I'm developing.
>
>
If you want to know the name of the table and the data that will be
inserted, then use the TriggerData instance that is passed to the
trigger. You'll find methods to obtain the relation name (i.e. the
table name) and the new tuple. That will be far more efficient then
parsing SQL statements.

Regards,
Thomas Hallgren

In response to

Browse pljava-dev by date

  From Date Subject
Next Message Thomas Hallgren 2005-06-09 07:10:46 [Pljava-dev] problem installing on ppc32 linux
Previous Message Joao Afonso 2005-06-08 15:05:41 [Pljava-dev] Obtaining Query from Trigger