I am trying to update a table that accepts two parameters (Integer and String) in where clause.
If I write a query that has no problem where I can directly write those in where clause but I am doing this programmatically where Insert
method of SQLite in Android need to be passed the values.
Insert accepts only String
arguments but I need to pass one String and one Integer, how do I achieve this?
Database.getInstance(getApplicationContext()).getWritableDatabase().update(st.tablename,
st.update(buy,Buyprice , Sell, Sellprice), (st.column2+" =? and "+ st.column3+" =? "),(new
String[] {getdate,name}));
In above command getdate
is Integer
and name
is String
but it is giving the error:
Type mismatch: cannot convert from Integer to String