Message208908
| Author |
terry.reedy |
| Recipients |
docs@python, terry.reedy |
| Date |
2014年01月23日.10:42:57 |
| SpamBayes Score |
-1.0 |
| Marked as misclassified |
Yes |
| Message-id |
<1390473779.26.0.463818219743.issue20364@psf.upfronthosting.co.za> |
| In-reply-to |
| Content |
"execute(sql[, parameters])
Executes an SQL statement. The SQL statement may be parametrized (i. e. placeholders instead of SQL literals). The sqlite3 module supports two kinds of placeholders: question marks (qmark style) and named placeholders (named style)."
Experimental facts based on experiments with the code example in the doc, using 3.4.b2: 'parameters' is a single subscriptable collection parameter, sequence or dict, that might be called seq_dict. It is positional only, so whatever name is used is a dummy. Only one placeholder style can be used in a given SQL statement string. If question marks are used, seq_dict must be a sequence. If names are used, seq_dict can be either a sequence or dict or subclass thereof. A UserDict is treated as a sequence and raises KeyError(0).
Possible text that encompasses the above, replacing the last sentence:
"A statement may use one of two kinds of placeholders: question marks (qmark style) or named placeholders (named style). For qmark style, seq_dict must be a sequence. For named style, it can be either a sequence or dict instance. Len(seq_dict) must match the number of placeholders."
After cleaning up the test file, I will verify on 2.7 and upload. |
|
History
|
|---|
| Date |
User |
Action |
Args |
| 2014年01月23日 10:42:59 | terry.reedy | set | recipients:
+ terry.reedy, docs@python |
| 2014年01月23日 10:42:59 | terry.reedy | set | messageid: <1390473779.26.0.463818219743.issue20364@psf.upfronthosting.co.za> |
| 2014年01月23日 10:42:58 | terry.reedy | link | issue20364 messages |
| 2014年01月23日 10:42:57 | terry.reedy | create |
|