Search Postgresql Archives

Problems with a Trigger Statement

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



I want the following trigger to update a related table when ever a record is inserted/updated. I have the following trigger:

CREATE TRIGGER update_status
 AFTER INSERT OR UPDATE
 ON public."Bug Status"
 FOR EACH ROW
 EXECUTE PROCEDURE public.update_status();

Which Calls this function:

CREATE OR REPLACE FUNCTION public.update_status()
RETURNS trigger AS
'
BEGIN UPDATE public."BugTracking" SET status = NEW.status WHERE "BugTracking"."Tracking Number" = NEW."Tracking Number"
END;
'
LANGUAGE 'plpgsql' VOLATILE;



When I go to insert a record I receive the following error:


ERROR:  syntax error at or near ""
CONTEXT:  compile of PL/pgSQL function "update_status" near line 4

Any one know where I am going wrong?? Thanks!

---------------------------(end of broadcast)---------------------------
TIP 2: you can get off all lists at once with the unregister command
   (send "unregister YourEmailAddressHere" to majordomo@postgresql.org)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux