[Pljava-dev] Obtaining Query from Trigger

Joao Afonso joaoaafonso at gmail.com
Wed Jun 8 15:05:41 UTC 2005


  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.

On 6/8/05, Thomas Hallgren <thhal at mailblocks.com> wrote:
> Joao Afonso wrote:
> 
> >  Ok, my mistake... I'll need to think of something else. But I still
> >need to get the query that fired on an insert, update or delete. Could
> >you help me with that??
> >
> >  Thanks in advance.
> >
> >
> I'm sorry but no, that's not planned. I can't really see the use-case
> where it would be really useful and it implies a fairly advanced
> mechanism. Consider the following:
> 
> INSERT INTO foo(a,b) SELECT a,b FROM bar;
> 
> in combination with a "BEFORE INSERT ON EACH ROW" trigger on table foo.
> What statement would you expect to see? Same thing is of course true for
> updates and deletes that deals with several rows.
> 
> Perhaps I'd be able to help if you elaborate a bit on what you want to
> use this for.
> 
> Regards,
> Thomas Hallgren
> 
> 
>



More information about the Pljava-dev mailing list