How to loop though an array plpgsql?

Поиск
Список
Период
Сортировка
От Matthew Schumacher
Тема How to loop though an array plpgsql?
Дата
Msg-id 42EABE20.6040805@aptalaska.net
обсуждение исходный текст
Ответы Re: How to loop though an array plpgsql?  (Michael Fuhr <mike@fuhr.org>)
Список pgsql-sql
I need to loop though an input array, but can't figure out how to do it,
the docs aren't really clear on this.

Something like this:

CREATE FUNCTION update (_id INTEGER[])
RETURNS VOID AS
$$
BEGIN
 FOR i IN SELECT _id LOOP   INSERT INTO table VALUES (_id[i]); END LOOP;

END;
$$
LANGUAGE plpgsql;

Anyone know the correct loop syntax?

schu


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

Предыдущее
От: daq
Дата:
Сообщение: Re: CREATE TABLE AS SELECT
Следующее
От: Kyle Bateman
Дата:
Сообщение: bug in information_schema?