Getting the values from the database and Error handling
Fetching the values from the SQLite3 database.
Print row values returned by select query
To fetch single matching fetchone() method
For multiple rows use fetchall() method
Error handling can be done using sqlite3.Error built in function
Sqlite3 - Not require separate server process.
The sqlite3 module was written by Gerhard Häring. To use the module, you must first create a Connection object that represents the database. Here the data will be stored in the example.db file:
You can also supply the special name :memory: to create a database in RAM. Once you have a Connection, you can create a Cursor object and call its execute() method to perform SQL commands:
This modified text is an extract of the original Stack Overflow Documentation created by following contributors
and released under CC BY-SA 3.0