Re: Need to Iterate the record in plpgsql

Поиск
Список
Период
Сортировка
От Pavel Stehule
Тема Re: Need to Iterate the record in plpgsql
Дата
Msg-id CAFj8pRBndqKqduazpLJM6gU8uAsC73=rdmJqJ3nSJASRzZP7OA@mail.gmail.com
обсуждение исходный текст
Ответ на Need to Iterate the record in plpgsql  ("Yelai, Ramkumar IN BLR STS" <ramkumar.yelai@siemens.com>)
Ответы Re: Need to Iterate the record in plpgsql
Список pgsql-sql
Hello

http://okbob.blogspot.cz/2010/12/iteration-over-record-in-plpgsql.html
http://postgres.cz/wiki/PostgreSQL_SQL_Tricks#Iteration_over_RECORD_variable_inside_trigger

Regards

Pavel Stehule

2012/8/31 Yelai, Ramkumar IN BLR STS <ramkumar.yelai@siemens.com>:
> Hi All,
>
> I am facing a issue in Iterating the RECORD.
>
> The problem is, I would like to iterate the RECORD without using sql query,
> but as per the syntax I have to use query as shown below.
>
> FOR target IN query LOOP
>     statements
> END LOOP [ label ];
>
> In my procedure, I have stored one of the procedure output as record, which
> I am later using in another iteration. Below is the example
>
>
> CREATE OR REPLACE FUNCTION test2()
>
> Rec1 RECORD;
> Rec2 RECORD;
> Rec3 RECORD;
>
> SELECT * INTO REC1 FROM test();
>
> FOR REC2 IN ( select * from test3())
> LOOP
>         FOR REC3 IN REC2 --- this syntax does not allowed by Postgresql
>         LOOP
>
>         END LOOP
> END LOOP
>
> As per the example, How can I iterate pre stored record.
>
> Please let me know if you have any suggestions.
>
> Thanks & Regards,
> Ramkumar
>
>
>
>
>



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

Предыдущее
От: "Yelai, Ramkumar IN BLR STS"
Дата:
Сообщение: Need to Iterate the record in plpgsql
Следующее
От: Sergey Konoplev
Дата:
Сообщение: Re: Need to Iterate the record in plpgsql