[Gambas-user] putting name with apostrophe into postgres via gambas

richard terry rterry at ...1822...
Tue Feb 19 06:32:44 CET 2008


On Tue, 19 Feb 2008 03:07:10 pm nando wrote:
> 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

For my slow to learn mind, I don't suppose you could post your string function 
to the list/me, so I can read something concrete?.

I've many different strings to save, and one can never tell if there could be 
those characters in them, so perhaps all strings need to be $$string$$ before 
saving. Seems to a bit tedious , unless of course where they are definately 
unwanted, they are excluded as the user types.

Thanks.

Richard


>
> ---------- 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 -------
>
>
> -------------------------------------------------------------------------
> 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






More information about the User mailing list