Professional Documents
Culture Documents
py
from .selectquery import *
from .insertquery import *
Code for the selectquery.py
import sqlite3
cursor.close()
cursor.close()
def getSingleRows():
try:
connection = sqlite3.connect('c:\sqlite\school.db')
cursor = connection.cursor()
print("Connected to database")
cursor.close()
def insertrow():
try:
connection = sqlite3.connect('c:\sqlite\school.db')
cursor = connection.cursor()
print("Successfully Connected to SQLite")
count = cursor.execute(sqlite_insert_query)
connection.commit()
print("Record inserted successfully into Student table ", cursor.rowcount)
cursor.close()
cursor.close()
def insertMultipleRecords(recordList):
try:
sqliteConnection = sqlite3.connect('c:\sqlite\school.db')
cursor = sqliteConnection.cursor()
print("Connected to SQLite")
cursor.executemany(sqlite_insert_query, recordList)
sqliteConnection.commit()
print("Total", cursor.rowcount, "Records inserted successfully into
SqliteDb_developers table")
sqliteConnection.commit()
cursor.close()
def updateSqliteTable():
try:
sqliteConnection = sqlite3.connect('c:\sqlite\school.db')
cursor = sqliteConnection.cursor()
print("Connected to SQLite")
a.getlimitedRows(2)
a.getSingleRows()
a.insertrow()
a.getAllRows()