I want to update a row via Pl/pgSQL in PostgreSQL but an error occurs. This is my code:
CREATE OR REPLACE FUNCTION "Surrogate_Del"(tablename text, surro uuid)
RETURNS void AS
$BODY$DECLARE
tblname text;
surrogate uuid;
BEGIN
tblname:=tablename;
surrogate:=surro;
execute 'UPDATE'||tblname||'SET ID=NULL WHERE surrogate='||surrogate|| ;
END$BODY$
LANGUAGE plpgsql
This is the UUID that I want to update record base on it
*syntax Error »ab7«
cd32cdf0-5ab7-11e2-abda-1c4bd605a98d
^*
How can I solve this problem?