I got a dictionary with 14 keys.
First Ive created createTableOfRecordsenter
function:
def createTableOfRecords(self):
create_table = '''CREATE TABLE IF NOT EXISTS records(Budget TEXT , Commitment TEXT, Contract_Type TEXT , Customer_Type TEXT, Duration TEXT , Goals TEXT, Pace TEXT ,
Procedures_and_Regulations TEXT, Resources TEXT , Scope TEXT, Team_Availability TEXT , Team_Distribution TEXT, Team_Size TEXT , Uncertainty TEXT);'''
self.cursor.execute(create_table)
self.connection.commit()
and the table with columns created successfully.
After that, I tried to insert the data using the insertRecords
function:
global var_dict
var_dict = dict(Budget="Fixed",
Commitment="Low",
Contract_Type="Hybrid",
Customer_Type="Market",
Duration="Long",
Goals="Unclear",
Pace="Fast",
Procedures_and_Regulations="None",
Resources="Standart",
Scope="Rigid",
Team_Availability="Fully",
Team_Distribution="Global",
Team_Size="Small",
Uncertainty="Predictable")
def insertRecords(self):
self.cursor.execute('INSERT INTO records (Budget,Commitment,Contract_Type,Customer_Type,Duration,Goals,Pace,'
'Procedures_and_Regulations,Resources,Scope,Team_Availability,'
'Team_Distribution,Team_Size,Uncertainty) '
'VALUES (:Budget, :Commitment, :Contract_Type, :Customer_Type, :Duration, '
':Goals, :Pace, :Procedures_and_Regulations, :Resources, :Scope, :Team_Availability, '
':Team_Distribution, :Team_Size, :Uncertainty);'), var_dict
self.connection.commit()
but I didn't get any value inserted into the database table. I got this error message:
self.cursor.execute('INSERT INTO records (Budget,Commitment,Contract_Type,Customer_Type,Duration,Goals,Pace,' sqlite3.ProgrammingError: Incorrect number of bindings supplied. The current statement uses 14, and there are 0 supplied.
Does anyone know what I've done wrong? Thanks!