I have loaded a csv file using python sql connector and it appears that the records have loaded fine and I can see the status of the load. When I select the table and click on the data tab it is blank. I have tried loading direct from heidi using the import function and it works fine. I thought that as long as data is loaded I should be able to see the data automatically. I used the load data infile... to load the file. Am I missing something?
Ps completely new to this apologise if this is a basic non understanding, can anyone help?
data of current selected table not showing in data tab
nope I used the following code:(responses output shown ##xxx##)- unless its the code that is an issue? I have even tried various forms of the query like adding in the table headers ... gives same result. The database actually shows the number of records loaded, I can't view or access them.
## loading data in a table ##
query = """LOAD DATA INFILE 'c:/data/CW_Data/GP_Practices.csv' REPLACE INTO TABLE gppractices FIELDS TERMINATED BY ',' IGNORE 1 LINES;"""
cur.execute(query)
#19800L#
db.commit ()
# built-in method of Connection object at 0x022394CB)##
## loading data in a table ##
query = """LOAD DATA INFILE 'c:/data/CW_Data/GP_Practices.csv' REPLACE INTO TABLE gppractices FIELDS TERMINATED BY ',' IGNORE 1 LINES;"""
cur.execute(query)
#19800L#
db.commit ()
# built-in method of Connection object at 0x022394CB)##
Hi I have attached a sample of the csv file and the CREATE TABLE CODE, the table created fine
cur.execute("DROP TABLE IF EXISTS GPPRACTICES")
sql = """CREATE TABLE GPPRACTICES(ID CHAR(10) NOT NULL, DATE DATE, PRACTICE_ID CHAR (20), NAME TEXT, ADDRESS1 TEXT,
ADDRESS2 TEXT, ADDRESS3 TEXT, ADDRESS4 TEXT, POSTCODE TEXT, PC_ID CHAR (10))"""
cur.execute(sql)
Thanks in advance if anyone can help
1 attachment(s):
Please login to leave a reply, or register at first.