Search Postgresql Archives

Re: PL/PGSQL - dynamic variable names

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

 



Actually there is a section in the manual on this problem:
http://www.postgresql.org/docs/9.0/static/plpgsql-implementation.html#PLPGSQL-VAR-SUBST


On 29 June 2011 11:41, Ben Carbery <ben.carbery@xxxxxxxxx> wrote:

Hm, "a" isn't a variable,it's the value of stuff[1].  

It's both..

DECLARE
    a integer;
    b integer;

The point is I want a dynamically named variable. Here I've named them the same as stuff[i] but they can be anything provided it is a different variable name on each loop iteration. The manual is not entirely clear on where loop variable substitution does and does not apply with FOR.

 
Did you try
declaring a,b,c,d as the return type of the respective functions?


How would this help?


[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