mercredi 1 juillet 2015

column names as variables while creating table

Iam new to python sqlite, and I have a problem with create table query.

I need to create a table, but I have the column names of the table as a list.

columnslist = ["column1", "column2", "column3"]

Now, I have to create a table MyTable with the above columns. But the problem is, I won't know before hand how may columns are there in columnslist

Is it possible to create a table with the number of and name of columns given in columnslist and its syntax?

Aucun commentaire:

Enregistrer un commentaire