0
我在sqlite3中建立3个表格。当我做下面的SELECT命令:iPhone应用程序中的sqlite3
select us.saleSpecificProduct,us.fAtMall,u.name,u.gender,st.storeName
from UsersSale us,Users u,Stores st
where u.userID=us.userID and st.storeID=us.saleStoreID order by us.saleID
它工作正常的外壳,但如果我在我的iPhone应用程序把这个说法,我得到一个错误。
/*
* read items from the database and store in itemw
*
*/
-(void)readItems {
if (!database) return; // earlier problems
// build select statement
if (!selStmt)
{
const char *sql = "select us.saleSpecificProduct,us.fAtMall,u.name,u.gender,st.storeName from UsersSale us,Users u,Stores st where u.userID=us.userID and st.storeID=us.saleStoreID order by us.saleID";
if (sqlite3_prepare_v2(database, sql, -1, &selStmt, NULL) != SQLITE_OK)
{
selStmt = nil;
}
当我执行的应用程序,我在 “sqlite3_prepare_v2” }
有什么不对得到错误?