arrays - Android: SQLite Function Doesn't Return Valid Data -
ok...i'm stumped! wrote following code circa 13-feb-2013 , has worked till few days ago:
/** * count of resources in selected alliance * * @param db ewtraker db * @param sector sector accessed * @param alliance alliance accessed */ public long[] getcountallc(sqlitedatabase db, string sector, string alliance){ if (buildconfig.debug) { log.i(constants.tag_dbhelper, "getcountallc(): sector: "+sector); log.i(constants.tag_dbhelper, "getcountallc(): alliance: "+alliance); } long[] mtblcountarray = new long[6]; string[] s = new string[2]; s[0] = sector; s[1] = alliance; try{ mtblcountarray[0] = databaseutils.querynumentries(db,"tplys","fsectr=? , faname=?",s); mtblcountarray[1] = databaseutils.querynumentries(db,"tbase","fsectr=? , faname=?",s); mtblcountarray[2] = databaseutils.querynumentries(db,"tbldg","fsectr=? , faname=?",s); mtblcountarray[3] = databaseutils.querynumentries(db,"ttrps","fsectr=? , faname=?",s); mtblcountarray[4] = databaseutils.querynumentries(db,"tinvy","fsectr=? , faname=?",s); mtblcountarray[5] = databaseutils.querynumentries(db,"tmsns","fsectr=? , faname=?",s); if (buildconfig.debug) { log.i(constants.tag_dbhelper, "getcountallc(): alliance no. of players: "+mtblcountarray[0]); log.i(constants.tag_dbhelper, "getcountallc(): alliance no. of bases: "+mtblcountarray[1]); log.i(constants.tag_dbhelper, "getcountallc(): alliance no. of buildings: "+mtblcountarray[2]); log.i(constants.tag_dbhelper, "getcountallc(): alliance no. of troup rows: "+mtblcountarray[3]); log.i(constants.tag_dbhelper, "getcountallc(): alliance no. of items: "+mtblcountarray[4]); log.i(constants.tag_dbhelper, "getcountallc(): alliance no. of missions: "+mtblcountarray[5]); } } catch (exception e) { log.e(constants.tag_dbhelper, "getcountallc(): exception while getting record count:"); log.e(constants.tag_dbhelper, "getcountallc(): cause: "+e.getcause()); log.e(constants.tag_dbhelper, "getcountallc(): message: "+e.getmessage()); e.printstacktrace(); } return mtblcountarray; }
i'm @ total loss , welcome tip point me in right direction. when completed numbers in array '0' when know 100% should greater '0'. arguments "sector" , "alliance" query valid , exist in queried tables in database.
thanks!
it turns out function work; problem particular piece of data entered.
Comments
Post a Comment