/Doc/includes/sqlite3/executescript.py
http://unladen-swallow.googlecode.com/ · Python · 24 lines · 23 code · 1 blank · 0 comment · 0 complexity · a640f6fd15777ca696e0860e6f13b2f6 MD5 · raw file
- 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 (
- 'Dirk Gently''s Holistic Detective Agency',
- 'Douglas Adams',
- 1987
- );
- """)