SQLite3错误 - iOS [英] SQLite3 error - iOS

查看:128
本文介绍了SQLite3错误 - iOS的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何判断SQLite3在进行SQL调用时给出的错误:

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(success != SQLITE_OK) {
  NSLog(@"create stmt failed %@",stmt);
}

据我所知,如果它失败了,但有没有办法获得实际错误或失败原因?

All as I know is if it failed, but is there a way to get the actual error, or reason why it failed?

推荐答案

当然,如果成功!= SQLITE_OK ,那么它必须是以下错误代码之一:

Sure, if success != SQLITE_OK, then it must be one of these error codes:

http://www.sqlite.org/c3ref/c_abort.html

这篇关于SQLite3错误 - iOS的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆