X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [64.117.224.130]) by svr1.postgresql.org (Postfix) with ESMTP id B1FC5D1B533 for ; Tue, 7 Oct 2003 17:18:40 +0000 (GMT) Received: from svr1.postgresql.org ([64.117.224.193]) by localhost (neptune.hub.org [64.117.224.130]) (amavisd-new, port 10024) with ESMTP id 49044-07 for ; Tue, 7 Oct 2003 14:17:51 -0300 (ADT) Received: from smtp1.mts.net (smtp1.mts.net [205.200.16.74]) by svr1.postgresql.org (Postfix) with ESMTP id 1B358D1B56A for ; Tue, 7 Oct 2003 14:17:50 -0300 (ADT) Received: from cleartag (wnpgmb01bby-ac03-p11-62.mts.net [142.161.11.62]) by smtp1.mts.net (8.12.8-20030918/8.11.3) with SMTP id h97HHU4C022115; Tue, 7 Oct 2003 12:17:36 -0500 (CDT) Message-ID: <00bc01c38cf6$f3aa3ed0$3e09a18e@cleartag> From: "George Weaver" To: "Kumar" , "psql" References: <027101c38cd2$9580e8a0$7502a8c0@hdsc.com> Subject: Re: Problem with Escape charactor Date: Tue, 7 Oct 2003 12:16:50 -0500 MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_NextPart_000_00B4_01C38CCC.E2B9F2C0" X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2800.1158 X-MIMEOLE: Produced By Microsoft MimeOLE V6.00.2800.1165 X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200310/84 X-Sequence-Number: 15484 This is a multi-part message in MIME format. ------=_NextPart_000_00B4_01C38CCC.E2B9F2C0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Kumar, Have you tried EXECUTE 'update "WATS".action_plan_master set rec_deleted_flag =3D \'Y\' W= HERE action_plan_id IN ('|| p_action_plan_ids || ')'; = ^ ^ HTH, George ----- Original Message -----=20 From: Kumar=20 To: psql=20 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 dynam= ic 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 =3D '= 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 =3D '|= | 'Y' ||' WHERE action_plan_id IN ('|| p_action_plan_ids || ')'; Error is=20 ERROR: Attribute "y" not found While EXECUTE 'update "WATS".action_plan_master set rec_deleted_flag =3D '|= | \'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 ------=_NextPart_000_00B4_01C38CCC.E2B9F2C0 Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable
Kumar,
 
Have you tried
 
EXECUTE 'update "WATS".action_plan_master set=20 rec_deleted_flag =3D  \'Y\' WHERE action_plan_id IN ('|| p_action_plan= _ids ||=20 ')';               =             &nb= sp;            =             &nb= sp;            =        ^ =20 ^
 
HTH,
George
----- Original Message -----
Fro= m:=20 Kumar<= /A>=20
Sent: Tuesday, October 07, 2003 7:= 57=20 AM
Subject: [SQL] Problem with Escape= =20 charactor

Dear Friends,
 
I am working with Postgres 7.3.4 on RH Linux 7.2 . I = am=20 executing a dynamic query inside a PL/pgSQL procedure and I am having the= =20 following problem.
 
While a line in the PL/pgSQL function is like the=20 following
    EXECUTE 'update=20 "WATS".action_plan_master set rec_deleted_flag =3D  'Y' WHERE=20 action_plan_id IN ('|| p_action_plan_ids || ')';
I got the following error.
    ERROR:  parser: parse err= or at=20 or near "Y" at character 68
 
While
    EXECUTE 'update=20 "WATS".action_plan_master set rec_deleted_flag =3D '|| 'Y' ||' WHERE=20 action_plan_id IN ('|| p_action_plan_ids || ')';
Error is
    ERROR:  Attribute "y" not= =20 found
 
While
    EXECUTE 'update=20 "WATS".action_plan_master set rec_deleted_flag =3D '|| \'Y\' ||' WHERE=20 action_plan_id IN ('|| p_action_plan_ids || ')';
Error is
    WARNING:  plpgsql: ERROR = during=20 compile of sp_del_met_001 near line 47
    ERROR: = =20 unterminated string
 
How can I specify a string charactor, as the PgAdmin3= is not=20 using double quotes for Strings. Anyone pls shed some light.<= /DIV>
 
Regards
Kumar

------=_NextPart_000_00B4_01C38CCC.E2B9F2C0--