plpgsql : adding record variable to table

Поиск
Список
Период
Сортировка
От thomas veymont
Тема plpgsql : adding record variable to table
Дата
Msg-id CAHcTkqqDPniDCF_eLqVrHfyYtZUXoGuh21w9_BToMSrJEbUung@mail.gmail.com
обсуждение исходный текст
Ответы Re: plpgsql : adding record variable to table  (Pavel Stehule <pavel.stehule@gmail.com>)
Список pgsql-sql
(sorry my previous email was truncated)

hi,

Here is what I want to do :

I want to check each row of a table against some conditions (this
check needs some
processing stuff I can easily code with pl/pgsql).

If the row is OK, I want to add it in a "resulting table",
else I just ignore the current row and go to next one.

My function looks like this : (simplified)

FUNCTION myfunction (...)  RETURNS TABLE ( elem1 , elem2, elem3 ...)
DECLARE  g RECORD
BEGINFOR g in SELECT colum1, column2, ... FROM someTable  LOOP     -- do some processing on "g", then decide wheter I
wantto
 
select it or not    IF (g is selected) THEN >>add g to resulting_table<<  END LOOP RETURN resulting_table

How should I write the "add g to resulting table" part ?

thanks,
Tom


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

Предыдущее
От: thomas veymont
Дата:
Сообщение: plpgsql : adding record variable to table
Следующее
От: Pavel Stehule
Дата:
Сообщение: Re: plpgsql : adding record variable to table