bhaskarReddy wrote:
> I have two arrays, one is representing field names and
> another array representing field types. I am passing these two arrays to
> another function which will create a table using sqlite3_exec.
>
> #define INTEGER 0
> #define TEXT1
>
> Ex: char *col_names[] = {"slotId", "cardId",
> "swversion"};
> int arr[] = {0,0,1};
>
> create_table (tableName, col_names, arr);
>
>Now in the function create_table(const char *tableName, const char
> *col_names, int *ptr)
> {
>char *query;
>
>query = "create table
> tableName (fieldNames and fieldTypes) ;";
> the actual database name and field names and values should come.
This question seems to have little to do with SQLite. It's just a
straightforward string manipulation. I suggest you consult your favorite C or
C++ textbook.
For one thing, I can't help but notice that, the way create_table function is
declared, it would have no way of knowing how many elements col_names array
contains.
--
Igor Tandetnik
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users