Skip to content

Commit 7ac0232

Browse files
committed
update query parameter formatting docs
issue pymssql#326
1 parent 8dc8e19 commit 7ac0232

1 file changed

Lines changed: 7 additions & 4 deletions

File tree

docs/ref/pymssql.rst

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -287,14 +287,17 @@ Cusor object methods
287287
Cursor.execute(operation, params)
288288

289289
*operation* is a string and *params*, if specified, is a simple value, a
290-
tuple, or ``None``.
290+
tuple, a dict, or ``None``.
291291

292292
Performs the operation against the database, possibly replacing parameter
293293
placeholders with provided values. This should be preferred method of
294294
creating SQL commands, instead of concatenating strings manually, what makes
295-
a potential of `SQL Injection attacks`_. This method accepts the same
296-
formatting as Python's builtin :ref:`string interpolation operator
297-
<python:string-formatting>`.
295+
a potential of `SQL Injection attacks`_. This method accepts formatting similar
296+
to Python's builtin :ref:`string interpolation operator
297+
<python:string-formatting>`. However, since formatting and type conversion is handled
298+
internally, only the ``%s`` placeholder is supported.
299+
300+
Keyed placeholders are supported if you provide a dict for *params*.
298301

299302
If you call ``execute()`` with one argument, the ``%`` sign loses its
300303
special meaning, so you can use it as usual in your query string, for

0 commit comments

Comments
 (0)