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

Arief Bayu Purwanto ariefbayu at ...626...
Tue Feb 19 06:51:31 CET 2008


On Feb 19, 2008 12:32 PM, richard terry <rterry at ...1822...> wrote:

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


My friend, I think you can use postgre's built in function called
pg_escape_string[1].

http://pgtclng.projects.postgresql.org/pgtcldocs-20070115/pg-escape-string.html


-- 
Arief Bayu Purwanto
About : http://about.freelancer.web.id/
Blog : http://bayu.freelancer.web.id/



More information about the User mailing list