pg.ddx.io  pljava-dev@postgresql.org mailing list archive  
help / color / mirror / Atom feed
Subject: [Pljava-dev] Obtaining Query from Trigger
Date: Wed, 08 Jun 2005 17:12:00 +0200
Message-ID: <thhal-0Q6OCA3WAzjYeMnbS6hzr+s4Abguc8E@mailblocks.com> (raw)
In-Reply-To: <ce04e69f05060808054ac098cd@mail.gmail.com>
References: <42A68EDA.1090206@mailblocks.com>
	<ce04e69f050607150868a9b80e@mail.gmail.com>
	<thhal-0XCeCAwV9zjYkHoY0KllhRjVR7BiY28@mailblocks.com>
	<42A70381.7060801@mailblocks.com>
	<ce04e69f05060807207c684553@mail.gmail.com>
	<thhal-0BJyCA71/zjY1rTR2es9iWrUdMVc4gY@mailblocks.com>
	<ce04e69f05060808054ac098cd@mail.gmail.com>
	<42A70AC0.7030409@mailblocks.com>
	<thhal-0Q6OCA3OAzjYT02DCwJUwx6yN2xIrsf@mailblocks.com>

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






view thread (6+ messages)

Message-ID: <thhal-0Q6OCA3WAzjYeMnbS6hzr+s4Abguc8E@mailblocks.com>
Permalink:  ../thhal-0Q6OCA3WAzjYeMnbS6hzr+s4Abguc8E@mailblocks.com/
Also on:    postgresql.org/message-id/thhal-0Q6OCA3WAzjYeMnbS6hzr+s4Abguc8E@mailblocks.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pljava-dev@postgresql.org
  Subject: Re: [Pljava-dev] Obtaining Query from Trigger
  In-Reply-To: <thhal-0Q6OCA3WAzjYeMnbS6hzr+s4Abguc8E@mailblocks.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox