Please Advice a little bit about INSERT or UPDATE in SQLITE
I'm using this code
NSString *insertSQL = [NSString stringWithFormat: @"INSERT INTO downloadedBook(bookID, courseID, bookName, bookPath, bookVersion, pageAmount, price, episode) VALUES (\"%@\",\"%@\", \"%@\", \"%@\", %f, %d,%f, \"%@\")",bookID,courseID,bookName,bookPath,bookVersion,pageAmount,price,episode];
for insert,
and this code
NSString *updateSQL = [NSString stringWithFormat: @"UPDATE downloadedBook SET bookID = \"%@\",courseID = \"%@\", bookName = \"%@\", bookPath = \"%@\", bookVersion = %f, pageAmount = %d, price = %f,episode = \"%@\" WHERE bookID = \"%@\"" , bookID,courseID,bookName,bookPath,bookVersion, pageAmount, price, episode,bookID];
for update.
It works fine.Now, how can I use if
conditions while performing these operations? For example I would like to check "if I have this, data will update" Please Advice.
How can I do this Please Guide me.