dynamic field names in a function. - Mailing list pgsql-general

From Soma Interesting
Subject dynamic field names in a function.
Date
Msg-id 5.0.2.1.0.20010329142546.02a54ea8@pop.telus.net
Whole thread Raw
Responses Re: dynamic field names in a function.  ("Eric G. Miller" <egm2@jps.net>)
List pgsql-general
I want to be able to reference NEW.field_0 though NEW.field_x where x is
coming from NEW.qty in a FOR loop of pl/pgsql function. Is this possible?

In other words:

FOR j IN 0..NEW.str LOOP

    ans := ''q'' || i || ''a'' || j;
    cor := ''q'' || i || ''c'' || j;
    eval := 'q'' || i || ''e'' || j;

    IF NEW.ans = NEW.cor
    THEN NEW.eval := 1;
    END IF;

END LOOP;


pgsql-general by date:

Previous
From: Martín Marqués
Date:
Subject: database dirs very stange on solaris
Next
From: Alexey Rodriguez Yakushev
Date:
Subject: Re: Consistent pg_dump's