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 rCLsrCY into a standard SQL string literal:
"'" + s.replace("'", "''") + "'"
I would looked into using parameterized queries ...
On Mon, 19 Aug 2024 11:24:06 +0200, J.O. Aho wrote:
I would looked into using parameterized queries ...
There are lots of cases they donrCOt handle. Like for example LIKE and
REGEXP operands.
On 23/08/2024 04.33, Lawrence D'Oliveiro wrote:
On Mon, 19 Aug 2024 11:24:06 +0200, J.O. Aho wrote:
I would looked into using parameterized queries ...
There are lots of cases they donrCOt handle. Like for example LIKE and
REGEXP operands.
LIKE:
select * from table where column1 like ?;
On Fri, 23 Aug 2024 07:52:38 +0200, J.O. Aho wrote:
On 23/08/2024 04.33, Lawrence D'Oliveiro wrote:
On Mon, 19 Aug 2024 11:24:06 +0200, J.O. Aho wrote:
I would looked into using parameterized queries ...
There are lots of cases they donrCOt handle. Like for example LIKE and
REGEXP operands.
LIKE:
select * from table where column1 like ?;
Like: you want to do a partial match on what the user typed. And what
the user typed can include characters like rCL%rCY and rCL_rCY, which you donrCOt want to be mistaken for wildcards.
Another example: can your parameterized queries handle dynamic SQL
like this?
On 25/08/2024 00.49, Lawrence D'Oliveiro wrote:
Another example: can your parameterized queries handle dynamic SQL like
this?
did you try to wrap it into a stored procedure?
| Sysop: | Amessyroom |
|---|---|
| Location: | Fayetteville, NC |
| Users: | 63 |
| Nodes: | 6 (0 / 6) |
| Uptime: | 492975:35:03 |
| Calls: | 840 |
| Files: | 1,301 |
| D/L today: |
16 files (28,385K bytes) |
| Messages: | 264,959 |