Re: [GENERAL] function return value inside a trigger function

2012-10-07 Thread joao tiago a. m. viegas
sorry for the late update thank you all, I found the cause, that specific sentence was correct, it was in another sentence of the same function, I think it was late at night and I was tired. thank you anyway best regards jtv On 27 September 2012 02:26, Tom Lane wrote: > joao viegas writes:

Re: [GENERAL] function return value inside a trigger function

2012-09-26 Thread Tom Lane
joao viegas writes: > does anybody knows how can I have something like: > select function_that_returns_int(NEW.field1) into NEW.field2; Works for me ... create table fooey (q1 int, q2 int); create function myt() returns trigger language plpgsql as $$ begin select abs(new.q1) into new.q2; re

Re: [GENERAL] function return value inside a trigger function

2012-09-26 Thread Bosco Rama
On 09/26/12 17:56, joao viegas wrote: > > does anybody knows how can I have something like: > select function_that_returns_int(NEW.field1) into NEW.field2; I think you want: select into NEW.field2 function_that_returns_int(NEW.field1); or even: NEW.field2 := function_that_returns_int(NEW.f

[GENERAL] function return value inside a trigger function

2012-09-26 Thread joao viegas
Hello Good Evening all, does anybody knows how can I have something like: select function_that_returns_int(NEW.field1) into NEW.field2; i.e., getting a function output and assign it to a variable inside the trigger. in a trigger function? I'm always getting: ERROR: SELECT query has no destinatio