Search Postgresql Archives

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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The problem was fixed by initializing the array before giving it a
value. Not surprising Postges isnt as popular as it should be. I was by
luck that I found this out - the manual says nothing about init arrays.

DECLARE
  id_var INTEGER[];
  record_var RECORD;
BEGIN
  id_var := '{}';
  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;



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux