Can't get the field = ANY(array) clause to work...

Поиск
Список
Период
Сортировка
От nboutelier@hotmail.com
Тема Can't get the field = ANY(array) clause to work...
Дата
Msg-id 1138689399.882515.208390@g43g2000cwa.googlegroups.com
обсуждение исходный текст
Ответы Re: Can't get the field = ANY(array) clause to work...  (Richard Huxton <dev@archonet.com>)
Re: Can't get the field = ANY(array) clause to work...  (Tom Lane <tgl@sss.pgh.pa.us>)
Re: Can't get the field = ANY(array) clause to work...  (nboutelier@hotmail.com)
Список pgsql-general
Has anyone successfully used the "ANY", "ALL", or "SOME" clause using
arrays? Cant seem to get this to work. Heres the gist of my function
which returns a SETOF INTEGER[]...

DECLARE
  id_var INTEGER[];
  record_var RECORD;
BEGIN
  id_var[0] := 1;
  id_var[1] := 2;
  id_var[2] := 3;
  FOR record_var IN
    SELECT id FROM myTable WHERE id = ANY(id_var)
  LOOP
    RETURN NEXT record_var.id;
  END LOOP;
  RETURN;
END;

I get an empty record set! Any help would be appreciated. Thanks! -Nick


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

Предыдущее
От: "James Harper"
Дата:
Сообщение: libpq questions
Следующее
От: Richard Huxton
Дата:
Сообщение: Re: How to define variables in psql scripts?