Translating with DrWatson… this can take a few seconds the first time.
This is a genuine, complex translation. DrWatson protects commands, error codes, and log output while naturally translating the surrounding text. It’s translated once and saved.
Richard Krenek could not insert a value containing an apostrophe (Rich's test) into a varchar column; backslash escapes failed. Rob Wilson and Ed Brown said to double the single quote ('Rich''s test'). A.Reynolds added that the value can be wrapped in double quotes instead. Solved.
Auto-generated by Claude from the posts below — may be imperfect; read the full thread.
Richard Krenek — — source: Informix-list mailing list archive (1991-1998)
I am trying to add the line "Rich's test" in a varchar field but I
cannot add the '. How would I do this? I've tried
"INSERT INTO testtable VALUES ('Rich\\'s test');" but that does not work.
Ive even tried \\\\' and \\\\\\'. Any ideas?
thanks,
Richard Krenek
↪ replying to Richard Krenek
Rob Wilson — — source: Informix-list mailing list archive (1991-1998)
Try 'Rich''s test'. The secret is to double ' and " when needed.
Richard Krenek (rkrenek@ihs.com) wrote:
: I am trying to add the line "Rich's test" in a varchar field but I
: cannot add the '. How would I do this? I've tried
: "INSERT INTO testtable VALUES ('Rich\\'s test');" but that does not work.
: Ive even tried \\\\' and \\\\\\'. Any ideas?
: thanks,
: Richard Krenek
--
Rob Wilson
rwilson@ntsource.com
↪ replying to Richard Krenek
Ed Brown — — source: Informix-list mailing list archive (1991-1998)
Try two single quotes, as in:
"INSERT INTO testtable VALUES ('Rich''s test');"
"Richard Krenek" <rkrenek@ihs.com> wrote in message
news:39649C40.31B0ABE1@ihs.com...
> I am trying to add the line "Rich's test" in a varchar field but I
> cannot add the '. How would I do this? I've tried
> "INSERT INTO testtable VALUES ('Rich\\'s test');" but that does not work.
> Ive even tried \\\\' and \\\\\\'. Any ideas?
>
> thanks,
> Richard Krenek
>
↪ replying to Richard Krenek
A.Reynolds — — source: Informix-list mailing list archive (1991-1998)
Richard Krenek <rkrenek@ihs.com> wrote in message
news:39649C40.31B0ABE1@ihs.com...
> I am trying to add the line "Rich's test" in a varchar field but I
> cannot add the '. How would I do this? I've tried
> "INSERT INTO testtable VALUES ('Rich\\'s test');" but that does not work.
> Ive even tried \\\\' and \\\\\\'. Any ideas?
>
> thanks,
> Richard Krenek
>
You can also add the value surrounded by double quotes as follows:
INSERT INTO testtable VALUES ("Rich's test");
Your privacy choices
We use strictly necessary cookies to make this site work. With your
consent we’d also use optional cookies for analytics and marketing. You can accept all,
reject all, or choose. Read our Cookie Policy.