注册 登录
编程论坛 SQLite论坛

用sqlite3_mprintf中对auto increment怎么赋值?

wwxfc 发布于 2010-11-28 17:24, 5793 次点击
char *sql="CREATE TABLE PhoneNote(ID integer primary key autoincrement);
sqlite3_exec(phone_db,sql,NULL,NULL,&errmsg);
sql="INSERT INTO PhoneNote values(NULL)";//这一句用mprintf怎么赋值?
sqlite3_exec(phone_db,sql,NULL,NULL,&errmsg);
1 回复
#2
DreamSkyCC2010-12-05 17:51
char *sql = NULL;
sql = sqlite3_mprintf("insert into PhoneNote values(NULL)");

这样应该可以了!
1