本文整理匯總了C++中DBResultToCRowset函數的典型用法代碼示例。如果您正苦於以下問題:C++ DBResultToCRowset函數的具體用法?C++ DBResultToCRowset怎麽用?C++ DBResultToCRowset使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。
在下文中一共展示了DBResultToCRowset函數的9個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C++代碼示例。
示例1: CAST
PyObjectEx *BookmarkDB::GetBookmarks(uint32 ownerID) {
DBQueryResult res;
if(!sDatabase.RunQuery(res,
"SELECT"
" CAST(bookmarkID AS SIGNED INTEGER) AS bookmarkID,"
" CAST(ownerID AS SIGNED INTEGER) AS ownerID,"
" CAST(itemID AS SIGNED INTEGER) AS itemID,"
" CAST(typeID AS SIGNED INTEGER) AS typeID,"
" memo,"
" created,"
" x, y, z,"
" CAST(locationID AS SIGNED INTEGER) AS locationID,"
" note,"
" creatorID,"
" folderID"
" FROM bookmarks"
" WHERE ownerID = %u",
ownerID))
{
sLog.Error( "BookmarkDB::GetBookmarks()", "Failed to query bookmarks for owner %u: %s.", ownerID, res.error.c_str() );
return(NULL);
}
return DBResultToCRowset(res);
}
示例2: DBResultToCRowset
PyRep* MailDB::GetNewMail(int charId)
{
DBQueryResult res;
if (!sDatabase.RunQuery(res, "SELECT messageID, senderID, toCharacterIDs, toListID, toCorpOrAllianceID, title, sentDate FROM mailMessage WHERE toCharacterIDs LIKE '%%%u%%'", charId))
return NULL;
return DBResultToCRowset(res);
}
示例3: Win32TimeNow
PyRep *CharacterDB::GetCharSelectInfo(uint32 characterID) {
DBQueryResult res;
uint32 worldSpaceID = 0;
// "SELECT itemName, typeID FROM entity WHERE itemID = (SELECT locationID FROM entity WHERE itemID = %u)", characterID
std::string shipName = "My Ship";
uint32 shipTypeID = 606;
uint32 unreadMailCount = 0;
uint32 upcomingEventCount = 0;
uint32 unprocessedNotifications = 0;
uint32 daysLeft = 14;
uint32 userType = 23;
uint64 skillQueueEndTime = ( Win32TimeNow() + (5*Win32Time_Hour) + (25*Win32Time_Minute) );
uint64 allianceMemberStartDate = Win32TimeNow() - 15*Win32Time_Day;
uint64 startDate = Win32TimeNow() - 24*Win32Time_Day;
if(!sDatabase.RunQuery(res,
"SELECT "
" itemName AS shortName,bloodlineID,gender,bounty,character_.corporationID,allianceID,title,startDateTime,createDateTime,"
" securityRating,character_.balance,character_.stationID,solarSystemID,constellationID,regionID,"
" petitionMessage,logonMinutes,tickerName, %u AS worldSpaceID, '%s' AS shipName, %u AS shipTypeID, %u AS unreadMailCount, %u AS upcomingEventCount, %u AS unprocessedNotifications, %u AS daysLeft, %u AS userType, 0 AS paperDollState, 0 AS newPaperdollState, 0 AS oldPaperdollState, skillPoints, " I64u " AS skillQueueEndTime, " I64u " AS allianceMemberStartDate, " I64u " AS startDate"
" FROM character_ "
" LEFT JOIN entity ON characterID = itemID"
" LEFT JOIN corporation USING (corporationID)"
" LEFT JOIN bloodlineTypes USING (typeID)"
" WHERE characterID=%u", worldSpaceID, shipName.c_str(), shipTypeID, unreadMailCount, upcomingEventCount, unprocessedNotifications, daysLeft, userType, skillQueueEndTime, allianceMemberStartDate, startDate, characterID))
{
codelog(SERVICE__ERROR, "Error in query: %s", res.error.c_str());
return NULL;
}
return DBResultToCRowset(res);
}
示例4: _log
PyRep *ItemDB::ListStationItems( uint32 characterID, uint32 stationID )
{
DBQueryResult res;
if( !sDatabase.RunQuery( res,
"SELECT itemID,"
" entity.typeID,"
" quantity,"
" locationID,"
" flag,"
" singleton,"
" contraband,"
" invGroups.categoryID,"
" invTypes.groupID"
" FROM entity"
" LEFT JOIN invTypes ON entity.typeID = invTypes.typeID"
" LEFT JOIN invGroups ON invTypes.groupID = invGroups.groupID"
" WHERE ownerID=%u"
" AND locationID=%u"
" AND flag=4", characterID, stationID ))
{
_log(DATABASE__ERROR, "Cant find items for character %u in station %u", characterID, stationID );
return NULL;
}
return DBResultToCRowset( res );
}
示例5: codelog
PyRep *MarketDB::GetOldPriceHistory(uint32 regionID, uint32 typeID) {
DBQueryResult res;
/*DBColumnTypeMap colmap;
colmap["historyDate"] = DBTYPE_FILETIME;
colmap["lowPrice"] = DBTYPE_CY;
colmap["highPrice"] = DBTYPE_CY;
colmap["avgPrice"] = DBTYPE_CY;
colmap["volume"] = DBTYPE_I8;
colmap["orders"] = DBTYPE_I4;
//ordering: (painstakingly determined from packets)
DBColumnOrdering ordering;
ordering.push_back("historyDate");
ordering.push_back("lowPrice");
ordering.push_back("highPrice");
ordering.push_back("avgPrice");
ordering.push_back("volume");
ordering.push_back("orders");*/
if(!sDatabase.RunQuery(res,
"SELECT"
" historyDate, lowPrice, highPrice, avgPrice,"
" volume, orders "
" FROM market_history_old "
" WHERE regionID=%u AND typeID=%u", regionID, typeID))
{
codelog(MARKET__ERROR, "Error in query: %s", res.error.c_str());
return NULL;
}
return(DBResultToCRowset(res));
}
示例6: return
PyObjectEx *BookmarkDB::GetBookmarks(uint32 ownerID) {
DBQueryResult res;
if(!DBcore::RunQuery(res,
"SELECT"
" bookmarkID,"
" ownerID,"
" itemID,"
" typeID,"
" memo,"
" created,"
" x, y, z,"
" locationID,"
" note,"
" creatorID,"
" folderID"
" FROM srvBookmarks"
" WHERE ownerID = %u",
ownerID))
{
SysLog::Error( "BookmarkDB::GetBookmarks()", "Failed to query bookmarks for owner %u: %s.", ownerID, res.error.c_str() );
return(NULL);
}
return DBResultToCRowset(res);
}
示例7: _log
PyRep *ObjCacheDB::Generate_invTypes()
{
DBQueryResult res;
const char *q = "SELECT typeID, groupID, typeName, description, graphicID, radius, mass, volume, capacity, portionSize, raceID, basePrice, published, marketGroupID, chanceOfDuplicating, soundID, categoryID, iconID, dataID FROM invTypes";
if(sDatabase.RunQuery(res, q)==false)
{
_log(SERVICE__ERROR, "Error in query for cached object 'config.BulkData.types': %s", res.error.c_str());
return NULL;
}
DBRowDescriptor* header = new DBRowDescriptor;
header->AddColumn("typeID", DBTYPE_I4);
header->AddColumn("groupID", DBTYPE_I2);
header->AddColumn("typeName", DBTYPE_WSTR);
header->AddColumn("description", DBTYPE_WSTR);
header->AddColumn("graphicID", DBTYPE_I4);
header->AddColumn("radius", DBTYPE_R8);
header->AddColumn("mass", DBTYPE_R8);
header->AddColumn("volume", DBTYPE_R8);
header->AddColumn("capacity", DBTYPE_R8);
header->AddColumn("portionSize", DBTYPE_I4);
header->AddColumn("raceID", DBTYPE_UI1);
header->AddColumn("basePrice", DBTYPE_CY);
header->AddColumn("published", DBTYPE_BOOL);
header->AddColumn("marketGroupID", DBTYPE_I2);
header->AddColumn("chanceOfDuplicating", DBTYPE_R8);
header->AddColumn("soundID", DBTYPE_I4);
header->AddColumn("categoryID", DBTYPE_I2);
header->AddColumn("iconID", DBTYPE_I4);
header->AddColumn("dataID", DBTYPE_I4);
return DBResultToCRowset(res, header);
}
示例8: codelog
PyObjectEx *MissionDB::GetAgents() {
DBQueryResult res;
if(!sDatabase.RunQuery(res,
"SELECT"
" agt.agentID,"
" agt.agentTypeID,"
" agt.divisionID,"
" agt.level,"
" chr.stationID,"
" agt.quality,"
" agt.corporationID,"
" bl.bloodlineID,"
" chr.gender"
" FROM agtAgents AS agt"
" LEFT JOIN characterstatic AS chr ON chr.characterID = agt.agentID"
" LEFT JOIN bloodlineTypes AS bl ON bl.bloodlineID = agt.agentTypeID"
))
{
codelog(SERVICE__ERROR, "Error in query: %s", res.error.c_str());
return NULL;
}
return(DBResultToCRowset(res));
}
示例9: USING
PyRep *ObjCacheDB::Generate_c_chrSchools()
{
DBQueryResult res;
const char *q = "SELECT raceID, schoolID, schoolName, description, graphicID, chrSchools.corporationID, chrSchools.agentID, newAgentID, iconID FROM chrSchools LEFT JOIN agtAgents USING (corporationID) GROUP BY schoolID";
if(sDatabase.RunQuery(res, q)==false)
{
_log(SERVICE__ERROR, "Error in query for cached object 'charCreationInfo.schools': %s", res.error.c_str());
return NULL;
}
return DBResultToCRowset(res);
}