Can I use parameters for the table name in sqlite3?

前端 未结 2 1094
暖寄归人
暖寄归人 2020-12-03 17:26

I\'m having some strange feeling abour sqlite3 parameters that I would like to expose to you.

This is my query and the fail message :

#query         


        
2条回答
  •  没有蜡笔的小新
    2020-12-03 17:40

    I know this is super old already but since your query is just a string you can always append the table name like this in C++:

    std::string queryString = "SELECT id FROM " + std::string(_db_name);
    

    or in objective-C:

    [@"SELECT id FROM " stringByAppendingString:_db_name];
    

提交回复
热议问题