Created
April 18, 2015 00:14
-
-
Save minorsecond/f0f54ae6cc68127c662d to your computer and use it in GitHub Desktop.
Not creating the DB for some reason.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
with jobdb: | |
if debug == 1: | |
print("DEBUGGING") | |
print("Connected to jobdb. Data to be inserted into JOBDB Database:") | |
print ("Lead Name: {0}, Job Name: {1}, Job Abbrev: {2}, Time Worked: {3}, Date: {4}, UUID: {5}")\ | |
.format(lead_name, job_name,job_abbrev, time, date, p_uuid) | |
cur.execute( | |
"INSERT INTO jobdb(UUID, Lead_name, Job_name, Job_abbrev, Time_worked, " | |
"Date) VALUES(?, ?, ?, ?, ?, ?)", [p_uuid, lead_name, job_name, job_abbrev, time, date] | |
) | |
jobdb.commit() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The Connection is created: jobdb = sqlite3.connect('jobdb.db')
The Table is created:
with jobdb:
if debug == 1:
cur.executescript('DROP TABLE IF EXISTS jobdb')
cur.execute(
'CREATE TABLE if not exists jobdb(Id INTEGER PRIMARY KEY, UUID TEXT, Date DATE, Lead_name TEXT, Job_name TEXT
, Job_abbrev TEXT, Time_worked TEXT)')