| From: | Adam Haberlach <adam(at)newsnipple(dot)com> | 
|---|---|
| To: | pgsql-general(at)postgresql(dot)org | 
| Subject: | Spot the error in my plpgsql... | 
| Date: | 2001-01-16 03:54:26 | 
| Message-ID: | 20010115195426.A4412@newsnipple.com | 
| Views: | Whole Thread | Raw Message | Download mbox | Resend email | 
| Thread: | |
| Lists: | pgsql-general | 
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(at)newsnipple(dot)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.
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Ian Harding | 2001-01-16 04:51:56 | Re: date/time | 
| Previous Message | Tom Lane | 2001-01-16 01:27:34 | Re: Spot the error in my plpgsql... |