[Gambas-user] putting name with apostrophe into postgres via gambas
nando
nando_f at ...951...
Tue Feb 19 05:07:10 CET 2008
I made a string function what escapes the following four characters: " ' ` \
the returned string is used for each string item in INSERT or UPDATE.
..it saved a lot of headaches
-Fernando
---------- Original Message -----------
From: "Arief Bayu Purwanto" <ariefbayu at ...626...>
To: rterry at ...1823..., "mailing list for gambas users"
<gambas-user at lists.sourceforge.net>
Sent: Tue, 19 Feb 2008 09:47:49 +0700
Subject: Re: [Gambas-user] putting name with apostrophe into postgres via gambas
> On Feb 19, 2008 7:11 AM, richard terry <rterry at ...1822...> wrote:
>
> > eg Peter's
> >
> > if one passes the name to an sql in code it ends up looking like:
> >
> > insert into whatevertable (name) values('Peter's');
>
> Taken from this archive[1], you can use :
>
> 'foo''s bar'
> 'foo\'s bar'
> $$foo's bar$$
>
> [1]http://archives.postgresql.org/pgsql-general/2005-11/msg01288.php
> --
> Arief Bayu Purwanto
> About : http://about.freelancer.web.id/
> Blog : http://bayu.freelancer.web.id/
> -------------------------------------------------------------------------
> This SF.net email is sponsored by: Microsoft
> Defy all challenges. Microsoft(R) Visual Studio 2008.
> http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
> _______________________________________________
> Gambas-user mailing list
> Gambas-user at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/gambas-user
------- End of Original Message -------
More information about the User
mailing list