Re: How to process inverted comma in "EXECUTE 'insert into xxx values(...) - Mailing list pgsql-sql

From Nemo Terry
Subject Re: How to process inverted comma in "EXECUTE 'insert into xxx values(...)
Date
Msg-id BAY19-F20DF994D619E22D574463AF53D0@phx.gbl
Whole thread Raw
In response to Re: How to process inverted comma in "EXECUTE 'insert into xxx values(...)  (Richard Huxton <dev@archonet.com>)
List pgsql-sql
quote_literal() works.Thanks a lot!


>From: Richard Huxton <dev@archonet.com>
>To: Nemo Terry <ntuser155@hotmail.com>
>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 



pgsql-sql by date:

Previous
From: "Rodrigo De León"
Date:
Subject: Re: How to process inverted comma in "EXECUTE 'insert into xxx values(...)
Next
From: Gary Stainburn
Date:
Subject: workday function