Hi, all.
I need to write functions along these lines:
CREATE FUNCTION functiongetfieldname(char) RETURNS varchar
AS 'SELECT fieldname FROM listoffields WHERE criterion=$1;' LANGUAGE
'sql'
CREATE FUNCTION blah(char,int2) RETURNS float
AS 'SELECT functiongetfieldname($1) FROM maintable WHERE
secondcriterion=$2;'
However, the second function obviously only returns the fieldname
returned by the first function. What I want it to do is return the
contents of the field whose name is returned by the first function. Is
this possible?
Alternative ways round considered, but I'd prefer not to mess with the
database design....
Thanks,
Moray
----------------------------------------------------------------------
----------------
Moray.McConnachie@computing-services.oxford.ac.uk