Python code coverage for Doc/includes/sqlite3/execsql_printall_1.py
# | count | content |
---|---|---|
1 | n/a | import sqlite3 |
2 | n/a | |
3 | n/a | # Create a connection to the database file "mydb": |
4 | n/a | con = sqlite3.connect("mydb") |
5 | n/a | |
6 | n/a | # Get a Cursor object that operates in the context of Connection con: |
7 | n/a | cur = con.cursor() |
8 | n/a | |
9 | n/a | # Execute the SELECT statement: |
10 | n/a | cur.execute("select * from people order by age") |
11 | n/a | |
12 | n/a | # Retrieve all rows as a sequence and print that sequence: |
13 | n/a | print(cur.fetchall()) |