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:17:55 +0100
Message-ID: <4368BC83.7060009@tada.se> (raw)
In-Reply-To: <loom.20051102T124317-786@post.gmane.org>
References: <loom.20051102T124317-786@post.gmane.org>
Nacho wrote:
> Hello
>
> I have a question, I have defined a java trigger and I want send from
> PostgreSQL more arguments than the TriggerData object
>
> I have the following code
>
> CREATE TRIGGER tu_elementos_instalacion_monitorizar_tr
> AFTER UPDATE
> ON elementos_instalacion_monitorizar
> FOR EACH ROW
> EXECUTE PROCEDURE sendudpmessagetr('valor');
>
> CREATE OR REPLACE FUNCTION sendudpmessagetr()
> RETURNS "trigger" AS
> 'tekniker.udpip.SendUdpMessage.sendudpmessagetr'
> LANGUAGE 'javau' VOLATILE;
> ALTER FUNCTION sendudpmessagetr() OWNER TO optemi;
>
> public static void sendudpmessagetr(TriggerData td) throws SQLException{...}
>
> My question is that if is it possible define
>
> public static void sendudpmessagetr(TriggerData td, String str1, String str2)
> throws SQLException{...}
>
> Or if it is possible to define inside the TriggerData more arguments because I
> have see in documentation that is avaliable the getArguments() method, but I
> don?t know how define these new arguments in the TRIGGER function
>
I'm not sure I understand the question. The TriggerData.getArguments()
will return an array of strings. There's no limit to the number of
strings. These strings are the arguments that you define in your EXECUTE
PROCEDURE xxx(arg1, arg2, arg3). In your case you can do
String[] args = td.getArguments();
if(td[0].equals("valor")) { ... }
But perhaps you're after something completely different?
Regards,
Thomas Hallgren
view thread (10+ messages) latest in thread
Message-ID: <4368BC83.7060009@tada.se>
Permalink: ../4368BC83.7060009@tada.se/
Also on: postgresql.org/message-id/4368BC83.7060009@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: <4368BC83.7060009@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