mirror of
https://github.com/python/cpython.git
synced 2025-10-17 12:18:23 +00:00
gh-95273: Condense sqlite3 executescript example (#95383)
This commit is contained in:
parent
3e7cad3bca
commit
e9c8de669d
2 changed files with 9 additions and 27 deletions
|
@ -1007,9 +1007,16 @@ Cursor Objects
|
|||
|
||||
*sql_script* must be a :class:`string <str>`.
|
||||
|
||||
Example:
|
||||
Example::
|
||||
|
||||
.. literalinclude:: ../includes/sqlite3/executescript.py
|
||||
# cur is an sqlite3.Cursor object
|
||||
cur.executescript("""
|
||||
begin;
|
||||
create table person(firstname, lastname, age);
|
||||
create table book(title, author, published);
|
||||
create table publisher(name, address);
|
||||
commit;
|
||||
""")
|
||||
|
||||
|
||||
.. method:: fetchone()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue