agora inbox for pljava-dev@postgresql.org
help / color / mirror / Atom feedSubject: [Pljava-dev] PLJAVA Trigger Function more arguments
Date: Wed, 02 Nov 2005 14:50:20 +0100
Message-ID: <4368C41C.4010408@tada.se> (raw)
In-Reply-To: <5234B8D9C36F9E4D9B1AF01013708B6B0152C01B@txindoki.tekniker.es>
References: <5234B8D9C36F9E4D9B1AF01013708B6B0152C01B@txindoki.tekniker.es>
Ignacio L?zaro wrote:
> Hello Thomas
>
> My intention is define a trigger in a table, that execute a java method defined in a java class 'tekniker.udpip.SendUdpMessage.sendudpmessagetr'
>
> The way in which I have defined the trigger is with the TRIGGER tu_elementos_instalacion_monitorizar_tr and the FUNCTION sendudpmessagetr (that is associated to the java class).
>
> I need to pass to the method of the java class 2 additional arguments ( stored in a table of the database ) but I don?t know which is the way to define this in the TRIGGER tu_elementos_instalacion_monitorizar_tr or in the FUNCTION sendudpmessagetr, perhaps there is other way more efficient to do
>
> Probably I can define this
>
> CREATE TRIGGER tu_elementos_instalacion_monitorizar_tr
> AFTER UPDATE
> ON elementos_instalacion_monitorizar
> FOR EACH ROW
> EXECUTE PROCEDURE sendudpmessagetr(varchar,varchar);
>
> but how can I define the values for both varchar arguments
>
I don't understand. Let's say you issue the following statement:
UPDATE elementos_instalacion_monitorizar SET xyz = 'abc' WHERE foo = 'bar';
This will trigger a call to your trigger. How did you plan to select
stuff from 'a table in the database' and pass parameters at that point?
PostgreSQL allows you to set fixed values which makes sense. Different
CREATE TRIGGER can appoint the same PROCEDURE but use different fixed
arguments.
Can you give me an example on how you would like to pass your values?
Just use SQL and forget about PL/Java for a moment.
Regards,
Thomas Hallgren
view thread (10+ messages) latest in thread
Message-ID: <4368C41C.4010408@tada.se>
Permalink: ../4368C41C.4010408@tada.se/
Also on: postgresql.org/message-id/4368C41C.4010408@tada.se
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] PLJAVA Trigger Function more arguments
In-Reply-To: <4368C41C.4010408@tada.se>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox