Groups | Search | Server Info | Login | Register
Groups > comp.databases.mysql > #7796
| Path | csiph.com!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail |
|---|---|
| From | Lawrence D'Oliveiro <ldo@nz.invalid> |
| Newsgroups | comp.databases.mysql |
| Subject | Escaping Strings |
| Date | Mon, 15 Jul 2024 22:46:15 -0000 (UTC) |
| Organization | A noiseless patient Spider |
| Lines | 9 |
| Message-ID | <v748rm$tapm$2@dont-email.me> (permalink) |
| MIME-Version | 1.0 |
| Content-Type | text/plain; charset=UTF-8 |
| Content-Transfer-Encoding | 8bit |
| Injection-Date | Tue, 16 Jul 2024 00:46:15 +0200 (CEST) |
| Injection-Info | dont-email.me; posting-host="55f74b4ae2f116c131f41dc172ef4daf"; logging-data="961334"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+FCaI6CIyC400ju1rn2LrP" |
| User-Agent | Pan/0.158 (Avdiivka; ) |
| Cancel-Lock | sha1:0tNpUOiEbDyw73xIMhdYbYknTP8= |
| Xref | csiph.com comp.databases.mysql:7796 |
Show key headers only | View raw
In standard SQL, backslashes have no special significance. String literals
are delimited by single quotes, and any characters (except single quotes)
are allowed in them; to include a single quote in the string, write it
twice.
So in Python, this expression is sufficient to turn a string āsā into a
standard SQL string literal:
"'" + s.replace("'", "''") + "'"
Back to comp.databases.mysql | Previous | Next — Next in thread | Find similar
Escaping Strings Lawrence D'Oliveiro <ldo@nz.invalid> - 2024-07-15 22:46 +0000
Re: Escaping Strings "J.O. Aho" <user@example.net> - 2024-08-19 11:24 +0200
Re: Escaping Strings Lawrence D'Oliveiro <ldo@nz.invalid> - 2024-08-23 02:33 +0000
Re: Escaping Strings "J.O. Aho" <user@example.net> - 2024-08-23 07:52 +0200
Re: Escaping Strings Lawrence D'Oliveiro <ldo@nz.invalid> - 2024-08-24 22:49 +0000
Re: Escaping Strings "J.O. Aho" <user@example.net> - 2024-08-25 09:27 +0200
Re: Escaping Strings Lawrence D'Oliveiro <ldo@nz.invalid> - 2024-09-05 06:11 +0000
csiph-web