Problem with Escape charactor - Mailing list pgsql-sql

From Kumar
Subject Problem with Escape charactor
Date
Msg-id 027101c38cd2$9580e8a0$7502a8c0@hdsc.com
Whole thread Raw
List pgsql-sql
Dear Friends,
 
I am working with Postgres 7.3.4 on RH Linux 7.2 . I am executing a dynamic query inside a PL/pgSQL procedure and I am having the following problem.
 
While a line in the PL/pgSQL function is like the following
    EXECUTE 'update "WATS".action_plan_master set rec_deleted_flag =  'Y' WHERE action_plan_id IN ('|| p_action_plan_ids || ')';
I got the following error.
    ERROR:  parser: parse error at or near "Y" at character 68
 
While
    EXECUTE 'update "WATS".action_plan_master set rec_deleted_flag = '|| 'Y' ||' WHERE action_plan_id IN ('|| p_action_plan_ids || ')';
Error is
    ERROR:  Attribute "y" not found
 
While
    EXECUTE 'update "WATS".action_plan_master set rec_deleted_flag = '|| \'Y\' ||' WHERE action_plan_id IN ('|| p_action_plan_ids || ')';
Error is
    WARNING:  plpgsql: ERROR during compile of sp_del_met_001 near line 47
    ERROR:  unterminated string
 
How can I specify a string charactor, as the PgAdmin3 is not using double quotes for Strings. Anyone pls shed some light.
 
Regards
Kumar

pgsql-sql by date:

Previous
From: sad
Date:
Subject: privileges
Next
From: pginfo
Date:
Subject: Interest query plan