mirror of
https://github.com/python/cpython.git
synced 2025-09-26 10:19:53 +00:00
SF #1738670, make example in doc work
This commit is contained in:
parent
d8f77debd1
commit
f2eb4cba1a
1 changed files with 6 additions and 0 deletions
|
@ -42,6 +42,12 @@ c.execute('''create table stocks
|
|||
# Insert a row of data
|
||||
c.execute("""insert into stocks
|
||||
values ('2006-01-05','BUY','RHAT',100,35.14)""")
|
||||
|
||||
# Save (commit) the changes
|
||||
conn.commit()
|
||||
|
||||
# We can also close the cursor if we are done with it
|
||||
c.close()
|
||||
\end{verbatim}
|
||||
|
||||
Usually your SQL operations will need to use values from Python
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue