Received: from localhost (maia-1.hub.org [200.46.204.191]) by postgresql.org (Postfix) with ESMTP id A01459FB542 for ; Tue, 15 May 2007 04:42:54 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.191]) (amavisd-maia, port 10024) with ESMTP id 61004-03 for ; Tue, 15 May 2007 04:42:50 -0300 (ADT) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.5 Received: from bay0-omc2-s38.bay0.hotmail.com (bay0-omc2-s38.bay0.hotmail.com [65.54.246.174]) by postgresql.org (Postfix) with ESMTP id 440EB9FB540 for ; Tue, 15 May 2007 04:42:50 -0300 (ADT) Received: from hotmail.com ([64.4.53.70]) by bay0-omc2-s38.bay0.hotmail.com with Microsoft SMTPSVC(6.0.3790.2668); Tue, 15 May 2007 00:42:48 -0700 Received: from mail pickup service by hotmail.com with Microsoft SMTPSVC; Tue, 15 May 2007 00:42:48 -0700 Message-ID: Received: from 67.29.128.36 by by19fd.bay19.hotmail.msn.com with HTTP; Tue, 15 May 2007 07:42:47 GMT X-Originating-IP: [203.125.54.38] X-Originating-Email: [ntuser155@hotmail.com] X-Sender: ntuser155@hotmail.com In-Reply-To: <46495D77.6050108@archonet.com> From: "Nemo Terry" To: pgsql-sql@postgresql.org Subject: Re: How to process inverted comma in "EXECUTE 'insert into xxx values(...) Date: Tue, 15 May 2007 15:42:47 +0800 Mime-Version: 1.0 Content-Type: text/plain; charset=gb2312; format=flowed X-OriginalArrivalTime: 15 May 2007 07:42:48.0689 (UTC) FILETIME=[A2782E10:01C796C4] X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=1.446 tagged_above=0 required=5 tests=AWL=-0.277, BAYES_40=-0.185, DNS_FROM_RFC_ABUSE=0.2, DNS_FROM_RFC_POST=1.708, MSGID_FROM_MTA_HEADER=0 X-Spam-Level: * X-Archive-Number: 200705/121 X-Sequence-Number: 28401 quote_literal() works.Thanks a lot! >From: Richard Huxton >To: Nemo Terry >CC: pgsql-sql@postgresql.org >Subject: Re: [SQL] How to process inverted comma in "EXECUTE 'insert into xxx values(...) >Date: Tue, 15 May 2007 08:12:55 +0100 > >Nemo Terry wrote: > > But I must use it in function,so... > > Do you have another solution? > > >>> because obj_name from another table has value like this:S'pore High > >>> Polymer. > >>> Following error raises: > >>> ERROR: syntax error at or near "pore" > >You'll want to look into the quote_ident() and quote_literal() functions >when constructing queries like this. > >See functions and operators / string functions for details. > >-- > Richard Huxton > Archonet Ltd > >---------------------------(end of broadcast)--------------------------- >TIP 6: explain analyze is your friend _________________________________________________________________ 享用世界上最大的电子邮件系统— MSN Hotmail。 http://www.hotmail.com