returning from a trigger

Поиск
Список
Период
Сортировка
От Luis Silva
Тема returning from a trigger
Дата
Msg-id BAY117-F3058674785648E6F4E029DB5C40@phx.gbl
обсуждение исходный текст
Ответ на Re: for loop help  ("A. Kretschmer" <andreas.kretschmer@schollglas.com>)
Ответы Re: returning from a trigger
stress tests problems
Список pgsql-novice
Hi there! I'm having a big problem. I'm creating a pl/pgsql function and I
want my function to return one table that I've created, but that info is
created by me:

-->Table

CREATE TABLE returnfunc
(
  error bool NOT NULL,
  result text NOT NULL,
  name text
)
WITHOUT OIDS;

-->Pl/pgsql func
CREATE OR REPLACE FUNCTION validate(pub text)
  RETURNS returnfunc AS
$BODY$
DECLARE
answer returnfunc
val_pub text;
asds Record;

BEGIN
    val_priv:=$1;

    EXECUTE 'SELECT count(*) FROM public_data WHERE
identity='||quote_literal(val_pub) INTO asds;

    IF asds.count=0 THEN
        answer.error='1';
        answer.result='DIAMETER_ERROR_USER_UNKNOWN';
        RETURN answer;
    END IF;

RETURN NULL;
END;
....

the problem is that this is returning " (t,DIAMETER_ERROR_USER_UNKNOWN,) "
and I want to return this information in different columns, like when i'm
doing a select to the returnfunc. Is that possible? is there another away of
doing this?  tks in advance



В списке pgsql-novice по дате отправления:

Предыдущее
От:
Дата:
Сообщение: Re: PostgreSQL a slow DB?
Следующее
От: "Luis Silva"
Дата:
Сообщение: Re: returning from a trigger