2010-05-20 4 views

답변

0

SQLite C API를 직접 사용하는 경우 (해당하지 않아야 함) sqlite_column_name() 함수를 사용하여 지정된 색인의 열 이름을 가져올 수 있습니다. 이 기능은 sqlite_column_count() 기능과 잘 작동합니다.

Flying Meat Database 랩퍼를 사용해야하는 경우 PRAGMA table_info(myTable)을 실행 한 다음 ResultSet을 반복 할 수 있습니다. 열 이름은 색인 1에 있습니다. 즉,

FMResultSet * infoRS = [db executeQuery:@"PRAGMA table_info(myTable)"]; 
while ([infoRS next]) { 
    NSLog(@"Column #%d: %@", [infoRS intForColumnIndex:0], [infoRS stringForColumnIndex:1]); 
} 
관련 문제