Can I use parameters for the table name in sqlite3?

前端 未结 2 1084
暖寄归人
暖寄归人 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:59

    Ooookay, should have looked more thoroughly on SO.

    Answers:
    - SQLite Parameters - Not allowing tablename as parameter
    - Variable table name in sqlite

    They are meant for Python, but I guess the same applies for C++.

    tl;dr:

    You can't pass the table name as a parameter.
    If anyone have a link in the SQLite documentation where I have the confirmation of this, I'll gladly accept the answer.

提交回复
热议问题