当前位置: 首页>>代码示例>>C++>>正文


C++ DBResultToRowset函数代码示例

本文整理汇总了C++中DBResultToRowset函数的典型用法代码示例。如果您正苦于以下问题:C++ DBResultToRowset函数的具体用法?C++ DBResultToRowset怎么用?C++ DBResultToRowset使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了DBResultToRowset函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: codelog

PyObject *CorporationDB::GetEveOwners() {
    DBQueryResult res;

    /*if (!sDatabase.RunQuery(res,
        " SELECT * FROM eveStaticOwners "))
    {
        codelog(SERVICE__ERROR, "Error in query: %s", res.error.c_str());
        return NULL;
    }*/
    if( !sDatabase.RunQuery( res,
        "(SELECT"
        " itemID AS ownerID,"
        " itemName AS ownerName,"
    " 0 AS ownerNameID,"
        " typeID"
        " FROM entity"
        " WHERE itemID < %u"
        " AND itemID NOT IN ( SELECT ownerID from eveStaticOwners ) )"
        " UNION ALL "
        "(SELECT"
        " ownerID, ownerName, 0 AS ownerNameID, typeID"
        " FROM eveStaticOwners)"
        " ORDER BY ownerID", EVEMU_MINIMUM_ID ) )
    {
        codelog(SERVICE__ERROR, "Error in query: %s", res.error.c_str());
        return NULL;
    }

    return DBResultToRowset(res);
}
开发者ID:Ahava,项目名称:evemu_server,代码行数:30,代码来源:CorporationDB.cpp

示例2: _log

PyObject *LSCDB::LookupChars(const char *match, bool exact) {
	DBQueryResult res;
	
	std::string matchEsc;
	sDatabase.DoEscapeString(matchEsc, match);
	if (matchEsc == "__ALL__") {
		if(!sDatabase.RunQuery(res,
			"SELECT "
			"	characterID, itemName AS characterName, typeID"
			" FROM character_"
			"  LEFT JOIN entity ON characterID = itemID"
			" WHERE characterID >= 140000000"))
		{
			_log(SERVICE__ERROR, "Error in LookupChars query: %s", res.error.c_str());
			return NULL;
		}
	} else {
		if(!sDatabase.RunQuery(res,
			"SELECT "
			"	characterID, itemName AS characterName, typeID"
			" FROM character_"
			"  LEFT JOIN entity ON characterID = itemID"
			" WHERE itemName %s '%s'", 
			exact?"=":"RLIKE", matchEsc.c_str()
		))
		{
			_log(SERVICE__ERROR, "Error in LookupChars query: %s", res.error.c_str());
			return NULL;
		}
	}
	
	return DBResultToRowset(res);
}
开发者ID:Almamu,项目名称:evemu_apocrypha,代码行数:33,代码来源:LSCDB.cpp

示例3: codelog

PyObject *CorporationDB::GetEveOwners() {
    DBQueryResult res;

    /*if (!sDatabase.RunQuery(res,
        " SELECT * FROM eveStaticOwners "))
    {
        codelog(SERVICE__ERROR, "Error in query: %s", res.error.c_str());
        return NULL;
    }*/
    if(!sDatabase.RunQuery(res,
            "(SELECT"
            " itemID as ownerID,"
            " itemName as ownerName,"
            " typeID FROM entity"
            " WHERE itemId <140000000 AND itemID NOT IN(select ownerID from evestaticowners))"
            " UNION ALL "
            "(SELECT * FROM evestaticowners)"
            " ORDER BY ownerID"))
	{
        codelog(SERVICE__ERROR, "Error in query: %s", res.error.c_str());
        return NULL;
    }

    return DBResultToRowset(res);
}
开发者ID:AlTahir,项目名称:Apocrypha_combo,代码行数:25,代码来源:CorporationDB.cpp

示例4: ID

PyRep *ConfigDB::GetDynamicCelestials(uint32 solarSystemID) {

    sLog.Error("ConfigDB::GetDynamicCelestials", "This query is intentionally made to yield an empty result.  It must be re-worked to provide actual data!");

    const std::string query = " SELECT "
                              "     `itemID`, "
                              "     `entity`.`typeID`, "
                              "     `invTypes`.`groupID`, "
                              "     `itemName`, "
                              "     0, " // This field refers to the orbitID of the dynamic celestial and needs to be implemented
                              "     0, " // This field refers to the boolean value of isConnector.  It may signify some sort of mission jump bridge
                              "     `x`, "
                              "     `y`, "
                              "     `z` "
                              " FROM `entity` JOIN `invTypes` ON `entity`.`typeID` = `invTypes`.`typeID`"
                              " WHERE "
                              "     `locationID` = %u AND " // In the future, the locationID field needs to be constrained to being a solarSystemID
                              "     `groupID` = -1"; // This is set to -1 because we do not know what the ID(s) of dynamic celestials is/are.

    DBQueryResult result;
    DBResultRow currentRow;

    if (!sDatabase.RunQuery(result, query.c_str(), solarSystemID))
    {
        codelog(SERVICE__ERROR, "Error in query: %s", result.error.c_str());
        return NULL;
    }

    return DBResultToRowset(result);
}
开发者ID:IonysTerra,项目名称:evemu_server,代码行数:30,代码来源:ConfigDB.cpp

示例5: _log

PyRep *RamProxyDB::AssemblyLinesGet(const uint32 containerID) {
    DBQueryResult res;

    if(!DBcore::RunQuery(res,
        "SELECT"
        " assemblyLineID,"
        " assemblyLineTypeID,"
        " containerID,"
        " nextFreeTime,"
        " costInstall,"
        " costPerHour,"
        " restrictionMask,"
        " discountPerGoodStandingPoint,"
        " surchargePerBadStandingPoint,"
        " minimumStanding,"
        " minimumCharSecurity,"
        " minimumCorpSecurity,"
        " maximumCharSecurity,"
        " maximumCorpSecurity"
        " FROM ramAssemblyLines"
        " WHERE containerID = %u",
        containerID))
    {
        _log(DATABASE__ERROR, "Failed to query assembly lines for container %u: %s.", containerID, res.error.c_str());
        return NULL;
    }

    return DBResultToRowset(res);
}
开发者ID:eve-moo,项目名称:evemu_server,代码行数:29,代码来源:RamProxyDB.cpp

示例6: codelog

PyObject *ConfigDB::GetMap(uint32 solarSystemID) {
    DBQueryResult res;

#ifndef WIN32
#warning a lot of missing data in GetMap
#endif
    //how in the world do they get a list in the freakin rowset for destinations???
    if(!sDatabase.RunQuery(res,
        "SELECT "
        "   itemID,"
        "   itemName,"
        "   typeID,"
        "   groupID,"
        "   solarSystemID AS locationID,"
        "   x,y,z,"
        "   NULL AS orbitID,"
        "   NULL AS destinations,"
        "   NULL AS xMin,"
        "   NULL AS xMax,"
        "   NULL AS yMin,"
        "   NULL AS yMax,"
        "   NULL AS zMin,"
        "   NULL AS zMax,"
        "   NULL AS luminosity"
        " FROM mapDenormalize"
        " WHERE solarSystemID=%u", solarSystemID
    ))
    {
        codelog(SERVICE__ERROR, "Error in query: %s", res.error.c_str());
        return NULL;
    }

    return DBResultToRowset(res);
}
开发者ID:IonysTerra,项目名称:evemu_server,代码行数:34,代码来源:ConfigDB.cpp

示例7: DBResultToRowset

PyObject *CharacterDB::GetTopBounties() {
    DBQueryResult res;
    if(!sDatabase.RunQuery(res, "SELECT `characterID`, `itemName` as `ownerName`, `bounty`, `online`  FROM character_  LEFT JOIN `entity` ON `characterID` = `itemID` WHERE `characterID` >= %u AND `bounty` > 0 ORDER BY `bounty` DESC LIMIT 0,100" , EVEMU_MINIMUM_ID)) {
        sLog.Error("CharacterDB", "Error in GetTopBounties query: %s", res.error.c_str());
        return NULL;
    }
    return DBResultToRowset(res);
}
开发者ID:Camwarp,项目名称:evemu_server,代码行数:8,代码来源:CharacterDB.cpp

示例8: DBResultToRowset

PyObject *AccountDB::GetEntryTypes() {
	DBQueryResult res;
	
	if(!sDatabase.RunQuery(res, "SELECT refTypeID AS entryTypeID,refTypeText AS entryTypeName,description FROM market_refTypes"))
    {
        sLog.Error("Account DB", "Error in query: %s", res.error.c_str());
		return NULL;
	}
	
	return DBResultToRowset(res);
}
开发者ID:Almamu,项目名称:evemu_apocrypha,代码行数:11,代码来源:AccountDB.cpp

示例9: codelog

PyObject *CharacterDB::GetOwnerNote(uint32 charID, uint32 noteID) {
	DBQueryResult res;

	if (!sDatabase.RunQuery(res, "SELECT note FROM chrOwnerNote WHERE ownerID = %u AND noteID = %u", charID, noteID))
	{
		codelog(SERVICE__ERROR, "Error on query: %s", res.error.c_str());
		return (NULL);
	}

	return DBResultToRowset(res);
}
开发者ID:adam3696,项目名称:evemu_apocrypha,代码行数:11,代码来源:CharacterDB.cpp

示例10: codelog

PyObject *MapDB::GetPseudoSecurities() {
	DBQueryResult res;
	
	if(!sDatabase.RunQuery(res, "SELECT solarSystemID, security FROM mapSolarSystems"))
	{
		codelog(SERVICE__ERROR, "Error in query: %s", res.error.c_str());
		return NULL;
	}
	
	return DBResultToRowset(res);
}
开发者ID:AlTahir,项目名称:Apocrypha_combo,代码行数:11,代码来源:MapDB.cpp

示例11: codelog

PyRep *MarketDB::GetPlayerItemsInStation( uint32 characterID, uint32 stationID )
{
	// Hack into NULL
	DBQueryResult res;

	if(!sDatabase.RunQuery(res,
		"SELECT itemID, itemName, typeID, ownerID, locationID, flag, contraband, singleton, quantity, x, y, z, custominfo, 0 AS categoryID, 0 AS groupID FROM entity WHERE  ownerID=%d && locationID=%d && flag=4", characterID, stationID)){
			codelog( MARKET__ERROR, "Error in query: %s", res.error.c_str() );
			return NULL;
	}
	return DBResultToRowset( res );
}
开发者ID:AlTahir,项目名称:Apocrypha_combo,代码行数:12,代码来源:MarketDB.cpp

示例12: IF

PyRep *RamProxyDB::GetJobs2(const uint32 ownerID, const bool completed, const uint64 fromDate, const uint64 toDate) {
    DBQueryResult res;

    if(!DBcore::RunQuery(res,
        "SELECT"
        " job.jobID,"
        " job.assemblyLineID,"
        " assemblyLine.containerID,"
        " job.installedItemID,"
        " installedItem.typeID AS installedItemTypeID,"
        " installedItem.ownerID AS installedItemOwnerID,"
        " blueprint.productivityLevel AS installedItemProductivityLevel,"
        " blueprint.materialLevel AS installedItemMaterialLevel,"
        // quite ugly, but lets us use DBResultToRowset
        " IF(assemblyLine.activityID = 1, blueprintType.productTypeID, installedItem.typeID) AS outputTypeID,"
        " job.outputFlag,"
        " job.installerID,"
        " assemblyLine.activityID,"
        " job.runs,"
        " job.installTime,"
        " job.beginProductionTime,"
        " job.pauseProductionTime,"
        " job.endProductionTime,"
        " job.completedStatusID != 0 AS completed,"
        " job.licensedProductionRuns,"
        " job.installedInSolarSystemID,"
        " job.completedStatusID AS completedStatus,"
        " station.stationTypeID AS containerTypeID,"
        " station.solarSystemID AS containerLocationID"
        " FROM srvRamJobs AS job"
        " LEFT JOIN srvEntity AS installedItem ON job.installedItemID = installedItem.itemID"
        " LEFT JOIN ramAssemblyLines AS assemblyLine ON job.assemblyLineID = assemblyLine.assemblyLineID"
        " LEFT JOIN srvInvBlueprints AS blueprint ON installedItem.itemID = blueprint.blueprintID"
        " LEFT JOIN invBlueprintTypes AS blueprintType ON installedItem.typeID = blueprintType.blueprintTypeID"
        " LEFT JOIN ramAssemblyLineStations AS station ON assemblyLine.containerID = station.stationID"
        " WHERE job.ownerID = %u"
        " AND job.completedStatusID %s 0"
        " AND job.installTime >= %" PRIu64
        " AND job.endProductionTime <= %" PRIu64
        " GROUP BY job.jobID"
        " ,job.assemblyLineID, assemblyLine.containerID, job.installedItemID, installedItemTypeID"
        " ,installedItemOwnerID, installedItemProductivityLevel, installedItemMaterialLevel, outputTypeID, job.outputFlag, job.installerID"
        " ,assemblyLine.activityID, job.runs, job.installTime, job.beginProductionTime, job.pauseProductionTime"
        " ,job.endProductionTime, completed, job.licensedProductionRuns, job.installedInSolarSystemID, completedStatus"
        " ,containerTypeID, containerLocationID",
        ownerID, (completed ? "!=" : "="), fromDate, toDate))
    {
        _log(DATABASE__ERROR, "Failed to query jobs for owner %u: %s", ownerID, res.error.c_str());
        return NULL;
    }

    return DBResultToRowset(res);
}
开发者ID:eve-moo,项目名称:evemu_server,代码行数:53,代码来源:RamProxyDB.cpp

示例13: _log

PyRep *PosMgrDB::GetControlTowerFuelRequirements() {
    DBQueryResult res;
    if (!sDatabase.RunQuery(res,
        " SELECT "
        "   controlTowerTypeID, resourceTypeID, purpose, quantity, factionID, minSecurityLevel "
        " FROM invControlTowerResources "))
    {
        _log(SERVICE__ERROR, "Error in GetControlTowerFuelRequirements query: %s", res.error.c_str());
        return (NULL);
    }

    return DBResultToRowset(res);
}
开发者ID:Ahava,项目名称:evemu_server,代码行数:13,代码来源:PosMgrDB.cpp

示例14: _log

PyRep *TutorialDB::GetAllCriterias() {
    DBQueryResult res;

    if(!sDatabase.RunQuery(res,
        "SELECT criteriaID, criteriaName, messageText, audioPath, 0 AS dataID"
        " FROM tutorial_criteria"))
    {
        _log(DATABASE__ERROR, "Error in query: %s", res.error.c_str());
        return NULL;
    }

    return DBResultToRowset(res);
}
开发者ID:Camwarp,项目名称:evemu_server,代码行数:13,代码来源:TutorialDB.cpp

示例15: _log

PyRep* PaperDollDB::GetMyPaperDollData() const {

    DBQueryResult res;
    if (!sDatabase.RunQuery(res,
        " SELECT "
        " sculptLocationID, weightKeyCategory, weightKeyPrefix "
        " FROM paperdollsculptinglocations"))
    {
        _log(DATABASE__ERROR, "Error in GetMyPaperDollData query: %s", res.error.c_str());
        return (NULL);
    }

    return DBResultToRowset(res);
}
开发者ID:Ahava,项目名称:evemu_server,代码行数:14,代码来源:PaperDollDB.cpp


注:本文中的DBResultToRowset函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。