I'm looking for an answer to the following question:
Is it possible to 'Create a Table' and to 'Input Values' with various Arrays?
My Problem is, that I have a large amount of values which I'd like to insert into the table. Because of that it's not really practical for me, to do the standard 'CreateTable' stuff like c.execute('''CREATE TABLE calc_matrix (date text, trans text, symbol text, qty real, price real)''')
I have the following Arrays which I like to insert:
1. Array: column_name [200] = [ColName1 string, ColName2 string, ...., ColName200 string]
2. Array: Result_1 [200] = [ Value1 int, Value2 double, Date date, Value3 float, ...., Value185 int, Value 186 float]
3. Array: Result_2 [200] = [ Value1 int, Value2 double, Date date, Value3 float, ...., Value185 int, Value 186 float]
4. Array: Result_3 [200] = [ Value1 int, Value2 double, Date date, Value3 float, ...., Value185 int, Value 186 float]
Finale Table Example:
[0]|ColName1|ColName2|ColName3|ColName4|...|ColName199|ColName200| ______________________________________________________________
[1]|Value1|Value2|Date|Value3|....|Value198|Value199|
[2]|Value1|Value2|Date|Value3|....|Value198|Value199|
[3]|Value1|Value2|Date|Value3|....|Value198|Value199|
[4]|Value1|Value2|Date|Value3|....|Value198|Value199|
.
.
.
[150]|Value1|Value2|Date|Value3|....|Value198|Value199|
Therefore I don't know how to accomplish that.
I've tried things like:
c.execute('''CREATE TABLE calc_matrix %s''', column_name)
Or in my loop:
c.execute('''CREATE TABLE calc_matrix ?''', column_name[i])
but nothing worked ......
Aucun commentaire:
Enregistrer un commentaire