I've got the following procedure...
DROP FUNCTION "blank_referring_devices" ();
CREATE FUNCTION "blank_referring_devices" () RETURNS opaque AS
'
BEGIN
EXECUTE ''UPDATE t_device SET accountid=NULL WHERE accountid =''
|| quote_literal(OLD.accountid);
END;
'
LANGUAGE 'plpgsql';
DROP TRIGGER "t_account_blank_devrel" ON "t_account";
CREATE TRIGGER "t_account_blank_devrel" BEFORE DELETE ON "t_account"
FOR EACH ROW EXECUTE PROCEDURE "blank_referring_devices" ();
And when I delete an account, I get the following:
test=# delete from t_account where accountid='6084751D55C11C3704B14FD4A87F3F7B';
ERROR: parser: parse error at or near "execute"
Any ideas?
--
Adam Haberlach |A cat spends her life conflicted between a
adam@newsnipple.com |deep, passionate, and profound desire for
http://www.newsnipple.com |fish and an equally deep, passionate, and
'88 EX500 |profound desire to avoid getting wet.