- (int)executeScalar:(NSString *)strQuery {
int intResult = -1;
const char *chrQuery = [strQuery UTF8String];
sqlite3_stmt *sqlStatement;
int returnValue = sqlite3_prepare_v2(database, chrQuery, -1, &sqlStatement, NULL);
if(returnValue == SQLITE_OK)
{
sqlite3_bind_text(sqlStatement, 1, chrQuery, -1, SQLITE_TRANSIENT);
returnValue = sqlite3_step(sqlStatement);
if(returnValue == SQLITE_DONE)
{
intResult = 0;
}
}
sqlite3_reset(sqlStatement);
return intResult;
}
int intResult = -1;
const char *chrQuery = [strQuery UTF8String];
sqlite3_stmt *sqlStatement;
int returnValue = sqlite3_prepare_v2(database, chrQuery, -1, &sqlStatement, NULL);
if(returnValue == SQLITE_OK)
{
sqlite3_bind_text(sqlStatement, 1, chrQuery, -1, SQLITE_TRANSIENT);
returnValue = sqlite3_step(sqlStatement);
if(returnValue == SQLITE_DONE)
{
intResult = 0;
}
}
sqlite3_reset(sqlStatement);
return intResult;
}