//成功返回SQLITE_OK ,即0
#define SQLITE_OK 0 /* Successful result */
/* beginning-of-error-codes */
//SQLITE 错误代码宏
#define SQLITE_ERROR 1 /* SQL error or missing database */
#define SQLITE_INTERNAL 2 /* Internal logic error in SQLite */
#define SQLITE_PERM 3 /* Access permission denied */
#define SQLITE_ABORT 4 /* Callback routine requested an abort */
#define SQLITE_BUSY 5 /* The database file is locked */
#define SQLITE_LOCKED 6 /* A table in the database is locked */
#define SQLITE_NOMEM 7 /* A malloc() failed */
#define SQLITE_READONLY 8 /* Attempt to write a readonly database */
#define SQLITE_INTERRUPT 9 /* Operation terminated by sqlite3_interrupt()*/
#define SQLITE_IOERR 10 /* Some kind of disk I/O error occurred */
#define SQLITE_CORRUPT 11 /* The database disk image is malformed */
#define SQLITE_NOTFOUND 12 /* NOT USED. Table or record not found */
#define SQLITE_FULL 13 /* Insertion failed because database is full */
#define SQLITE_CANTOPEN 14 /* Unable to open the database file */
#define SQLITE_PROTOCOL 15 /* NOT USED. Database lock protocol error */
#define SQLITE_EMPTY 16 /* Database is empty */
#define SQLITE_SCHEMA 17 /* The database schema changed */
#define SQLITE_TOOBIG 18 /* String or BLOB exceeds size limit */
#define SQLITE_CONSTRAINT 19 /* Abort due to constraint violation */
#define SQLITE_MISMATCH 20 /* Data type mismatch */
#define SQLITE_MISUSE 21 /* Library used incorrectly */
#define SQLITE_NOLFS 22 /* Uses OS features not supported on host */
#define SQLITE_AUTH 23 /* Authorization denied */
#define SQLITE_FORMAT 24 /* Auxiliary database format error */
#define SQLITE_RANGE 25 /* 2nd parameter to sqlite3_bind out of range */
#define SQLITE_NOTADB 26 /* File opened that is not a database file */
#define SQLITE_ROW 100 /* sqlite3_step() has another row ready */
#define SQLITE_DONE 101 /* sqlite3_step() has finished executing */
/* end-of-error-codes */
第一步:查看是否有死锁存在,查出有数据则代表有死锁
select p.spid,c.object_name,b.session_id,b.oracle_username,b.os_user_name from v$process p,v$session a,v$locked_object b,all_objects c
where p.addr=a.paddr
and a.process=b.process
and c.object_id=b.object_id
» 阅读全文
基础知识把握的不牢固,所以又在网上搜这个问题,看到这篇文章讲述的比较清楚,索性转载下来:(原文:olsonlowey)
Varchar 对每个英文(ASCII)字符都占用2个字节,对一个汉字也只占用两个字节
char 对英文(ASCII)字符占用1个字节,对一个汉字占用2个字节
Varchar 的类型不以空格填满,比如varchar(100),但它的值只是"qian",则它的值就是"qian"
而char 不一样,比如char(100),它的值是"qian",而实际上它在数据库中是"qian "(qian后共有96个空格,
就是把它填满为 100个字节)。
» 阅读全文
直以来我都以为MYSQL不支持事务处理,所以在处理多个数据表的数据时,一直都很麻烦(我是不得不将其写入文本文件,在系统重新加载得时候才写入数据库 以防出错)~今天发现MYSQL数据库从4.1就开始支持事务功能,据说5.0将引入存储过程^_^
» 阅读全文
初涉PHP和mysql的新手都可能会遇到一个头疼的问题:乱码!解决和规避乱码问题其实很简单,只要字符集统一,一般不会出现问题。这篇文章从实例讲解了如何解决mysql数据库的乱码问题。
» 阅读全文