Corrects sqlite code

This commit is contained in:
Sergey Kalinin 2017-03-23 15:00:47 +03:00
parent 0c5a9641e9
commit bf9dd44d62

6
dm.py
View File

@ -138,7 +138,7 @@ def createTables(tbl_list):
tbl_descr_list.append(one_Table_descr)
tbl_struct_list.append(one_Table_struct)
print(qwery_create)
c.execute(qwery_create)
#c.execute(qwery_create)
return tbl_names_list
def initDBstructure():
@ -160,7 +160,7 @@ def selectData(tbl):
if item[0] == tbl:
for field in item[1]:
field = field[0]
qwery = qwery + field + ","
qwery = qwery + '\'' + field + '\'' + ","
for rel in item[2]:
field = rel[0]
field_rel = rel[1][0]
@ -184,7 +184,7 @@ def selectData(tbl):
subqwery = "(SELECT (" + field_replace + ") FROM " + subqwery +" WHERE "+ table1 + "." + field1 +"="+ tbl +"."+ field +") AS " + field
qwery = qwery.replace(field, subqwery)
qwery = qwery.rstrip(',') + " FROM " + tbl + " LIMIT 10000"
#print(qwery)
print(qwery)
c.execute(qwery)
return c.fetchall()