CREATE TABLE footable(id integer, sometext text);
CREATE OR REPLACE FUNCTION foofunction()
RETURNS VOID AS $$
DECLARE
id_parameter integer;
BEGIN
INSERT INTO footable(sometext) VALUES('footext') RETURNING id;
id_parameter:=id;
PERFORM call_foo_function(id_parameter);
END LANGUAGE plpgsql VOLATILE;
此代码无效。
如何获取返回id并将其设置为id_parameter变量,以便在call_foo_function(id_parameter)中将其用作参数。