pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: George Weaver <georgew1@mts.net>
To: Kumar <sgnerd@yahoo.com.sg>
To: psql <pgsql-sql@postgresql.org>
Subject: Re: Problem with Escape charactor
Date: Tue, 7 Oct 2003 12:16:50 -0500
Message-ID: <00bc01c38cf6$f3aa3ed0$3e09a18e@cleartag> (raw)
References: <027101c38cd2$9580e8a0$7502a8c0@hdsc.com>

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

view thread (2+ messages)

Message-ID: <00bc01c38cf6$f3aa3ed0$3e09a18e@cleartag>
Permalink:  ../00bc01c38cf6$f3aa3ed0$3e09a18e@cleartag/
Also on:    postgresql.org/message-id/00bc01c38cf6$f3aa3ed0$3e09a18e@cleartag

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: georgew1@mts.net, sgnerd@yahoo.com.sg
  Subject: Re: Problem with Escape charactor
  In-Reply-To: <00bc01c38cf6$f3aa3ed0$3e09a18e@cleartag>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

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