pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Kumar <sgnerd@yahoo.com.sg>
To: psql <pgsql-sql@postgresql.org>
Subject: Problem with Escape charactor
Date: Tue, 7 Oct 2003 18:27:21 +0530
Message-ID: <027101c38cd2$9580e8a0$7502a8c0@hdsc.com> (raw)

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)  latest in thread

Message-ID: <027101c38cd2$9580e8a0$7502a8c0@hdsc.com>
Permalink:  ../027101c38cd2$9580e8a0$7502a8c0@hdsc.com/
Also on:    postgresql.org/message-id/027101c38cd2$9580e8a0$7502a8c0@hdsc.com

 · 

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: sgnerd@yahoo.com.sg
  Subject: Re: Problem with Escape charactor
  In-Reply-To: <027101c38cd2$9580e8a0$7502a8c0@hdsc.com>

* 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