dynamic field names in a function.
Andy Koch <dfunct@telus.net>
From: Soma Interesting <dfunct@telus.net>
To: pgsql-general@postgresql.org
Date: 2001-03-29T22:38:31Z
Lists: 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;