pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
Problem with Escape charactor
2+ messages / 2 participants
[nested] [flat]

* Problem with Escape charactor
@ 2003-10-07 12:57  Kumar <sgnerd@yahoo.com.sg>
  0 siblings, 1 reply; 2+ messages in thread

From: Kumar @ 2003-10-07 12:57 UTC (permalink / raw)
  To: 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

^ permalink  raw  reply  [nested|flat] 2+ messages in thread

* Re: Problem with Escape charactor
@ 2003-10-07 17:16  George Weaver <georgew1@mts.net>
  parent: Kumar <sgnerd@yahoo.com.sg>
  0 siblings, 0 replies; 2+ messages in thread

From: George Weaver @ 2003-10-07 17:16 UTC (permalink / raw)
  To: Kumar <sgnerd@yahoo.com.sg>; pgsql-sql

Kumar,

Have you tried

EXECUTE 'update "WATS".action_plan_master set rec_deleted_flag =  \'Y\' WHERE action_plan_id IN ('|| p_action_plan_ids || ')';                                                                        ^  ^

HTH,
George
  ----- Original Message ----- 
  From: Kumar 
  To: psql 
  Sent: Tuesday, October 07, 2003 7:57 AM
  Subject: [SQL] Problem with Escape charactor


  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

^ permalink  raw  reply  [nested|flat] 2+ messages in thread


end of thread, other threads:[~2003-10-07 17:16 UTC | newest]

Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2003-10-07 12:57 Problem with Escape charactor Kumar <sgnerd@yahoo.com.sg>
2003-10-07 17:16 ` George Weaver <georgew1@mts.net>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox