I have two .sqlite files. One for full version and one for Lite version. I am choosing one .sqlite file for one condition with this code:
if (FULLVERSION) {
self.databaseName = @"Alpha.sqlite";
}
else {
self.databaseName = @"AlphaLite.sqlite";
}
Now when I query I want to use this self.databaseName in that. I am doing like this now:
-(NSMutableArray *) Alpha {
sqlite3 *database;
if(sqlite3_open([databasePath UTF8String], &database) == SQLITE_OK) {
const char *sqlStatement = "SELECT * FROM Alpha";
sqlite3_stmt *compiledStatement;
if(sqlite3_prepare_v2(database, sqlStatement, -1, &compiledStatement, NULL) == SQLITE_OK) {
}
sqlite3_finalize(compiledStatement);
}
sqlite3_close(database);
return alpha;
}
In "SELECT * FROM Alpha" line, in place of Alpha I want to use self.databaseName, which will have database name according to the condition.
How to do this? Please help. Thanks.