@@ -1940,15 +1940,18 @@ close the single quote and inject ``OR TRUE`` to select all rows::
1940
1940
Instead, use the DB-API's parameter substitution. To insert a variable into a
1941
1941
query string, use a placeholder in the string, and substitute the actual values
1942
1942
into the query by providing them as a :class: `tuple ` of values to the second
1943
- argument of the cursor's :meth: `~Cursor.execute ` method. An SQL statement may
1944
- use one of two kinds of placeholders: question marks (qmark style) or named
1945
- placeholders (named style). For the qmark style, ``parameters `` must be a
1946
- :term: `sequence <sequence> `. For the named style, it can be either a
1947
- :term: `sequence <sequence> ` or :class: `dict ` instance. The length of the
1948
- :term: `sequence <sequence> ` must match the number of placeholders, or a
1949
- :exc: `ProgrammingError ` is raised. If a :class: `dict ` is given, it must contain
1950
- keys for all named parameters. Any extra items are ignored. Here's an example of
1951
- both styles:
1943
+ argument of the cursor's :meth: `~Cursor.execute ` method.
1944
+
1945
+ An SQL statement may use one of two kinds of placeholders:
1946
+ question marks (qmark style) or named placeholders (named style).
1947
+ For the qmark style, *parameters * must be a
1948
+ :term: `sequence ` whose length must match the number of placeholders,
1949
+ or a :exc: `ProgrammingError ` is raised.
1950
+ For the named style, *parameters * should be
1951
+ an instance of a :class: `dict ` (or a subclass),
1952
+ which must contain keys for all named parameters;
1953
+ any extra items are ignored.
1954
+ Here's an example of both styles:
1952
1955
1953
1956
.. testcode ::
1954
1957
@@ -1975,6 +1978,11 @@ both styles:
1975
1978
1976
1979
[('C', 1972)]
1977
1980
1981
+ .. note ::
1982
+
1983
+ :pep: `249 ` numeric placeholders are *not * supported.
1984
+ If used, they will be interpreted as named placeholders.
1985
+
1978
1986
1979
1987
.. _sqlite3-adapters :
1980
1988
0 commit comments