0
特定の行タイプのすべての行の詳細を取得しようとしています。Sqliteクエリが機能しない
Select * from MainTable where [email protected]
これは機能しません。私はより多くの選択肢を試しましたが、成功はありませんでした。誰でもObjective-Cの正しい形式が何であるか教えてもらえますか?
完全なコードを使用すると、FirefoxのアドオンのSQLiteマネージャー
https://addons.mozilla.org/en-US/firefox/addon/sqlite-manager/
あなたがプログラムに書くことができます同じクエリを使用してdbのSQLiteのためのクエリを発射できる
if(sqlite3_open([databasePath UTF8String], &database) == SQLITE_OK) {
//const char *sqlStatement = "SELECT * FROM MainTable"; ??it is working
const char *sqlStatement = "SELECT * FROM MainTable where JOB1='Paint'";//but not this one
sqlite3_stmt *compiledStatement;
NSLog(@"query set");
if(sqlite3_prepare_v2(database, sqlStatement, -1, &compiledStatement, NULL) == SQLITE_OK) {
while(sqlite3_step(compiledStatement) == SQLITE_ROW) {
NSString *job = [NSString stringWithUTF8String:(char *)sqlite3_column_text(compiledStatement, 0)];
NSString *image = [NSString stringWithUTF8String:(char *)sqlite3_column_text(compiledStatement, 1)];
NSString *tools = [NSString stringWithUTF8String:(char *)sqlite3_column_text(compiledStatement, 2)];
NSString *materials = [NSString stringWithUTF8String:(char *)sqlite3_column_text(compiledStatement, 3)];
NSString *people = [NSString stringWithUTF8String:(char *)sqlite3_column_text(compiledStatement, 4)];
NSString *safety = [NSString stringWithUTF8String:(char *)sqlite3_column_text(compiledStatement, 5)];
NSLog(@"%@",job);
NSLog(@"image %@",image);
NSLog(@"tools %@",tools);
NSLog(@"materials %@",materials);
NSLog(@"people %@",people);
NSLog(@"safety %@",safety);
なぜ機能しないのですか?どのようなエラーが発生しますか?また、このクエリをバインドする方法を示してください。 – sergio