SQLite3 error - iOS

前端 未结 2 1991
难免孤独
难免孤独 2021-01-20 14:22

How can I figure out the error that SQLite3 is giving me when I make an SQL call:

int success = sqlite3_prepare_v2(database, sql, -1, &stmt, NULL);

if(s         


        
2条回答
  •  感动是毒
    2021-01-20 14:59

    You can use the sqlite3_errmsg function. You need to pass in the db handle. The following code will log the error

    NSLog(@"Error %s while preparing statement", sqlite3_errmsg(_dbHandle));
    

提交回复
热议问题