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
|
| Список | 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 по дате отправления: