Search Postgresql Archives

PLPGSQL - store fetched records in array of record

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

 



Hello!

I have to store some fetched records into two lists (arrays) to work with them.

I can use the RECORD type in a FOR SELECT loop to get one row data.

declare 
  f record;
begin 
  for f in select title, length

But if I tried to define an "array of record", I got an error message.

declare 
  R_A record[]; <---- some error

So I can't store the fetched data into an array simply.

Ok, I found a solution when I define a TYPE, and I use this:

declare 
  f TMy_Record;
  R_A TMy_Record[];

Then I can work with the data.

But this means a dependency, so I can't change the TYPE without pre-dropping the stored procedure (and without recreating after).

Is there any way to avoid this? To use a "simple untyped record" in an array without "dependencies"?

Thank you for the answer!

Best regards
dd

[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 Databases]     [Postgresql & PHP]     [Yosemite]

  Powered by Linux