android.database.sqlite.SQLiteException: no such column

前端 未结 4 481
自闭症患者
自闭症患者 2020-12-01 17:20

when i execute this query i get \'android.database.sqlite.SQLiteException: no such column\' what is the error?

    public Cursor Getupdate(String rid)          


        
相关标签:
4条回答
  • 2020-12-01 17:32

    You can also use like this.

    db.rawQuery("SELECT _id FROM  Meeting   where meet=?" ,
                new String [] {rid});
    

    This will also solve for SQL injection problem.

    0 讨论(0)
  • 2020-12-01 17:45

    For string data type always use quotes like this '"+rid+"'" since rid is String you get error.

    You should use +rid only if rid is int.

    0 讨论(0)
  • 2020-12-01 17:46

    Or, better yet, use a PreparedStatement and bind your variables. It'll escape strings and dates properly for you. It'll also help with SQL injection problems.

    0 讨论(0)
  • 2020-12-01 17:58

    you need to use apostrophe(') in Where clause checking.. like

    db.rawQuery("SELECT _id FROM  Meeting   where meet='"+rid+"'" , null);
    
    0 讨论(0)
提交回复
热议问题