19 messages in org.postgresql.pgsql-generaldynamic field names in a function.
FromSent OnAttachments
Soma InterestingMar 29, 2001 2:38 pm 
Jeff EckermannMar 30, 2001 9:29 am 
Soma InterestingMar 30, 2001 10:06 am 
Soma InterestingMar 30, 2001 10:57 am 
Soma InterestingMar 30, 2001 1:58 pm 
Jeff EckermannMar 30, 2001 2:09 pm 
Soma InterestingMar 30, 2001 2:33 pm 
will trillichMar 30, 2001 3:46 pm 
Soma InterestingMar 30, 2001 4:38 pm 
will trillichMar 30, 2001 4:47 pm 
Soma InterestingMar 30, 2001 6:02 pm 
Eric G. MillerMar 30, 2001 7:29 pm 
Tom LaneMar 30, 2001 9:42 pm 
will trillichMar 30, 2001 10:04 pm 
will trillichMar 30, 2001 10:13 pm 
Tom LaneMar 31, 2001 4:57 pm 
will trillichApr 1, 2001 9:23 pm 
Tom LaneApr 1, 2001 11:27 pm 
Soma InterestingApr 3, 2001 1:23 pm 
Actions with this message:
Paste this link in email or IM:
Paste this link in email or IM:
Atom feed for this thread
Paste this URL into your reader:
Subject:dynamic field names in a function.Actions...
From:Soma Interesting (dfu@telus.net)
Date:Mar 29, 2001 2:38:09 pm
List:org.postgresql.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;