cpython/Doc/lib/sqlite3/executescript.py

25 lines
419 B
Python
Raw Normal View History

import sqlite3
con = sqlite3.connect(":memory:")
cur = con.cursor()
cur.executescript("""
create table person(
firstname,
lastname,
age
);
create table book(
title,
author,
published
);
insert into book(title, author, published)
values (
2006-09-08 11:06:42 -03:00
'Dirk Gently''s Holistic Detective Agency',
'Douglas Adams',
1987
);
""")