Hi,
I would like to write a generic plpgsql function with a text parameter being a
callback function name so that my general function can call this callback
function. e.g.:
CREATE OR REPLACE FUNCTION ST_MyCallbackFunction(y int)
RETURNS int AS $$
DECLARE
BEGIN
RETURN someCalculationBasedOnY;
END;
$$ LANGUAGE 'plpgsql';
CREATE OR REPLACE FUNCTION ST_MyGeneralFunction(callback text)
RETURNS SETOF geomval AS $$
DECLARE
x integer;
y integer;
BEGIN
y := somecalculation;
x := 'callback'(y); --This is what I need
RETURN x;
END;
$$ LANGUAGE 'plpgsql';
I don't want to do an EXECUTE statement since I have no table to put after the
FROM clause. I want to assign the resulting value directly to a variable like
in my example.
Can I/How can I achieve this?
Thanks,
Pierre
--
Sent via pgsql-general mailing list ([email protected])
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general