Thread: Trouble With Strings

Trouble With Strings

From
Colin Taylor
Date:
Hi,
I have been having a few problems with strings (varchar)s.
How can I insert a quote ' character in a string?
The following, needless to say does not work:

    INSERT INTO table (string) VALUES ('colin's');

Also, are there any other characters that need special attention in order to
put them into the table?
And how can I handle them?
Thanks,
Colin


Re: Trouble With Strings

From
"Richard Huxton"
Date:
----- Original Message -----
From: "Colin Taylor" <Colin_Taylor@PortaSystemsDev.com>


> Hi,
> I have been having a few problems with strings (varchar)s.
> How can I insert a quote ' character in a string?
> The following, needless to say does not work:
>
> INSERT INTO table (string) VALUES ('colin's');
>
INSERT INTO table VALUES ('colin\'s back\\slash');

The doubled-backslash is used to put a backslash in. Perl, PHP and the like
provide help with this sort of thing.

- Richard