How to use rawQuery() method to insert a record?

前端 未结 4 1613
挽巷
挽巷 2020-12-18 00:36

I need to store a record using rawQuery() method, because I want to insert the current date and time (datetime()), but I also need to insert string

4条回答
  •  抹茶落季
    2020-12-18 01:10

    String sql="INSERT INTO sms VALUES ( null, '"+str1+"', '"+str2+"', '"+str3+"', datetime())";
    dbw.rawQuery(sql, null);
    

    Mark the single quotes.

提交回复
热议问题