02-29-2012 12:49 AM
I am inserting data into a table on the blackberry SD Card. I now need to update my statement to avoid the insert statement running or not inserting when the value already exists.
I have tried a few things but cannot get it to work.
Any suggestions would be greatly appreciated.
02-29-2012 12:52 AM
02-29-2012 01:52 AM
You can try to use the select query and check whether it returns a parameter if it does you can use the update query to update it.
d = DatabaseFactory.open(myURI);
Statement st = d.createStatement("select Names from tip where id=?");
Cursor c = st.getCursor();
//then use update query to update that record
//use ur own insert query.
Hope it was helpfull