Hi, I had a question puzzled me. How can I get the type of a parameter in a
prepared SQL.

For example, the code is:

 

sqlite3 *conn;

    if (SQLITE_OK != sqlite3_open("testBind.db", &conn))

    {

       printf("can't open the database.");

       return ;

    }

 

if(SQLITE_OK != sqlite3_exec(conn, "create table  test_for_cpp(id
integer,name text,age integer)", 0, 0, 0))

    {

       return ;

    }

 

   sqlite3_stmt *ppStmt;

    const char *pzTail;     

    int nVal =sqlite3_prepare_v2(

       conn,           

       "INSERT INTO [test_for_cpp] ([id], [age], [name]) VALUES (?, ?,
'xiaowang') ; ",        

       -1,            

       &ppStmt,  

       &pzTail    

    );

 

 

How can I get the type of the specific column that a “?” referenced to?
For example, I want to get the type (here is integer) of the first column
that the first “?” referenced to.

 

 

Gu Jinxiang

 

以上、よろしくお��いします。

 

 

_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to