@@ -1437,15 +1437,18 @@ close the single quote and inject ``OR TRUE`` to select all rows::
1437
1437
Instead, use the DB-API's parameter substitution. To insert a variable into a
1438
1438
query string, use a placeholder in the string, and substitute the actual values
1439
1439
into the query by providing them as a :class: `tuple ` of values to the second
1440
- argument of the cursor's :meth: `~Cursor.execute ` method. An SQL statement may
1441
- use one of two kinds of placeholders: question marks (qmark style) or named
1442
- placeholders (named style). For the qmark style, ``parameters `` must be a
1443
- :term: `sequence <sequence> `. For the named style, it can be either a
1444
- :term: `sequence <sequence> ` or :class: `dict ` instance. The length of the
1445
- :term: `sequence <sequence> ` must match the number of placeholders, or a
1446
- :exc: `ProgrammingError ` is raised. If a :class: `dict ` is given, it must contain
1447
- keys for all named parameters. Any extra items are ignored. Here's an example of
1448
- both styles:
1440
+ argument of the cursor's :meth: `~Cursor.execute ` method.
1441
+
1442
+ An SQL statement may use one of two kinds of placeholders:
1443
+ question marks (qmark style) or named placeholders (named style).
1444
+ For the qmark style, *parameters * must be a
1445
+ :term: `sequence ` whose length must match the number of placeholders,
1446
+ or a :exc: `ProgrammingError ` is raised.
1447
+ For the named style, *parameters * should be
1448
+ an instance of a :class: `dict ` (or a subclass),
1449
+ which must contain keys for all named parameters;
1450
+ any extra items are ignored.
1451
+ Here's an example of both styles:
1449
1452
1450
1453
.. testcode ::
1451
1454
@@ -1472,6 +1475,11 @@ both styles:
1472
1475
1473
1476
[('C', 1972)]
1474
1477
1478
+ .. note ::
1479
+
1480
+ :pep: `249 ` numeric placeholders are *not * supported.
1481
+ If used, they will be interpreted as named placeholders.
1482
+
1475
1483
1476
1484
.. _sqlite3-adapters :
1477
1485
0 commit comments