vendredi 9 octobre 2015

How to create dynamic sql string according to unknown column count

I think the title is clearly. There is a sqlite app in android. The app is when starts, it's creates a database and tables. But the tables, columns, types, column count absolutely not specific. So, I need to create a perfect dynamic structure. I will take columns, tables, types and anything of about database from a xml. That is the point, the xml...

String query = "CREATE TABLE IF NOT EXISTS a(" + col_parameter1 +" " type_paramater1+","+ col_paramaterN + " " + type_parameterN ... +")" ;

I dont know how many creates table, how many colunms. I do try too way but all of them not perfect.

Aucun commentaire:

Enregistrer un commentaire