?? omcdr.cpp
字號(hào):
char GtpName[LEN_TABLENAME + 1]; char GtpId[LEN_SEQ + 1]; int FlagRead; int FlagRepeat; int FlagR499; char SystemType; char ServedIMSI[17]; char ServedIMEI[17]; char ServedMSISDN[LEN_ServedMSISDN+1]; char SGSNIPAddress[46]; char MSNetworkCapability[LEN_MSNetworkCapability+1]; char RoutingAreaCode[9]; char LocationAreaCode[17]; char CellIdentity[25]; /*int ChargingID;*/ char RecordOpenTime[LEN_DATETIME + 1]; char CallDuration[13]; char SGSNChange; char CauseForRecClosing[3]; char Diagnostics[LEN_Diagnostics+1]; char RecordSequenceNumber[11]; char LocalRecordSequeceNumnber[11]; /* CAMEL Information*/ char SCFAddress[LEN_SCFAddress+1]; char ServiceKey[LEN_ServiceKey+1]; char DefaultTransacHandling; char CAMELAPNNI[64]; char CAMELAPNOI[38]; char NumberOfDPEncounter[11]; char LevelOfCamelService[4]; char FreeFormatData[161]; char FFDAppendIndicator; char DefaultSMSHandling; char CAMELCallingPartyNumber[15]; char CAMELAccessDestinationSubNumber[44]; char CAMELSMSAdress[21]; char SmsReferenceNumber[9]; char DateCreated[LEN_DATETIME + 1]; char GsnId[11]; char NodeId[21]; char RecordExtensions[LEN_RecordExtensions+1]; int ChargingCharacterSelectionMode; char ChargingCharacteristics[LEN_ChargingCharacteristics+1]; struct S_OMCDR_LOAD *pOMCDR=*pOutCDR ; int nNumber = 0; char szMsg[512]; char szSQL[SQLMAX]; char szSQL2[SQLMAX]; char szSQL3[SQLMAX]; struct S_OMCDR_LOAD* p2; int j; char * sz ; *nItems=0; if(pOMCDR != NULL) { return -1; } snprintf(szSQL2, SQLMAX, "SELECT COUNT(*) FROM %s WHERE %s", pInSzTableName,pWhere); snprintf(szSQL,SQLMAX,"SELECT ""SEQID,""FLAGREAD,""GTPID,""GTPLTABLE,""MERGEID,""MERGETABLE,""FLAGREPEAT,""FLAGR499,""SERVEDIMSI,""SERVEDIMEI,""SGSNIPADDRESS,""MSNNETWORKCAPABILITY,""ROUTINGAREACODE,""LOCATIONAREACODE,""CELLIDENTITY,""EVENTSTAMPTIME,""CALLDURATION,""SGSNCHANGE,""CAUSEFORRECCLOSING,""DIAGNOSITICS,""RECORDSEQUENCENUMBER,""NODEID,""RECORDEXTENSIONS,""LOCALRECORDSEQUECENUMBER,""SERVEDMSISDN,""SYSTEMTYPE,""CHARGINGCHARACTERISTICS,""CHARGINGCHARACTERSELECTIONMODE,""SCFADDRESS,""SERVICEKEY,""DEFAULTTRANSACHANDLING,""CAMELAPNNI,""CAMELAPNOI,""NUMBEROFDPENCOUNTER,""LEVELOFCAMELSERVICE,""FREEFORMATDATA,""FFDAPPENDINDICATOR,""DEFAULTSMSHANDLING,""CAMELCALLINGPARTYNUMBER,""CAMELACCESSDESTNO,""CAMELSMSADDRESS,""SMSREFERENCENUMBER,""DATECREATED,""GSNID" " FROM %s WHERE %s", pInSzTableName,pWhere); #ifdef _DEBUG#ifdef LOG_SELECT logOra(sErrLog, szSQL);#endif#endif Lock(); nNumber=DbCount(szSQL2,myConnect); if(nNumber <= 0) { Unlock(); * nItems = 0; return 0; } sz = (char *)malloc(SIZE_S_OMCDR_LOAD*nNumber); memset(sz, 0, SIZE_S_OMCDR_LOAD*nNumber); mysql_real_query(myConnect, szSQL, strlen(szSQL)); MYSQL_RES *res_ptr = mysql_store_result(myConnect); if (res_ptr == NULL) { return -1; } MYSQL_ROW sqlrow;#ifdef _DEBUG logOra(sErrLog, "CURSOR...");#endif for(j=0;j<nNumber;j++) { sqlrow = mysql_fetch_row(res_ptr); p2 = (struct S_OMCDR_LOAD*)&sz[SIZE_S_OMCDR_LOAD*j]; p2->nChangeLocation = 0; p2->pChangeLocation = NULL; if (sqlrow[0] != NULL) memcpy(p2->SeqId,sqlrow[0],LEN_SEQ); // if (sqlrow[2] != NULL) memcpy(p2->GtpId,sqlrow[2],LEN_SEQ); // memcpy(p2->GtpName,sqlrow[],LEN_TABLENAME); if (sqlrow[7] != NULL) p2->FlagR499=atoi(sqlrow[7]); if (sqlrow[8] != NULL) memcpy(p2->ServedIMSI,sqlrow[8],17); if (sqlrow[9] != NULL) memcpy(p2->ServedIMEI,sqlrow[9],17); if (sqlrow[24] != NULL) memcpy(p2->ServedMSISDN,sqlrow[24],LEN_ServedMSISDN); if (sqlrow[10] != NULL) memcpy(p2->SGSNIPAddress,sqlrow[10],46); if (sqlrow[11] != NULL) memcpy(p2->MSNetworkCapability,sqlrow[11],LEN_MSNetworkCapability); if (sqlrow[12] != NULL) memcpy(p2->RoutingAreaCode,sqlrow[12],9); if (sqlrow[13] != NULL) memcpy(p2->LocationAreaCode,sqlrow[13],17); if (sqlrow[18] != NULL) memcpy(p2->CauseForRecClosing,sqlrow[18],3); if (sqlrow[19] != NULL) memcpy(p2->Diagnostics,sqlrow[19],LEN_Diagnostics); if (sqlrow[20] != NULL) memcpy(p2->RecordSequenceNumber,sqlrow[20],11); if (sqlrow[21] != NULL) memcpy(p2->NodeId,sqlrow[21],21); if (sqlrow[23] != NULL) memcpy(p2->LocalRecordSequeceNumnber,sqlrow[23],11); if (sqlrow[25] != NULL) p2->SystemType=atoi(sqlrow[25]); if (sqlrow[28] != NULL) memcpy(p2->SCFAddress,sqlrow[28],LEN_SCFAddress+1); if (sqlrow[29] != NULL) memcpy(p2->ServiceKey,sqlrow[29],10); if (sqlrow[30] != NULL) p2->DefaultTransacHandling=atoi(sqlrow[30]); if (sqlrow[31] != NULL) memcpy(p2->CAMELAPNNI,sqlrow[31],64); if (sqlrow[32] != NULL) memcpy(p2->CAMELAPNOI,sqlrow[32],38); if (sqlrow[33] != NULL) memcpy(p2->NumberOfDPEncounter,sqlrow[33],11); if (sqlrow[34] != NULL) memcpy(p2->LevelOfCamelService,sqlrow[34],4); if (sqlrow[35] != NULL) memcpy(p2->FreeFormatData,sqlrow[35],161); if (sqlrow[36] != NULL) p2->FFDAppendIndicator=atoi(sqlrow[36]); if (sqlrow[37] != NULL) p2->DefaultSMSHandling=atoi(sqlrow[37]); if (sqlrow[38] != NULL) memcpy(p2->CAMELCallingPartyNumber,sqlrow[38],15); if (sqlrow[39] != NULL) memcpy(p2->CAMELAccessDestinationSubNumber,sqlrow[39],44); if (sqlrow[40] != NULL) memcpy(p2->CAMELSMSAdress,sqlrow[40],21); if (sqlrow[41] != NULL) memcpy(p2->SmsReferenceNumber,sqlrow[41],9); if (sqlrow[42] != NULL) memcpy(p2->DateCreated,sqlrow[42],LEN_DATETIME); if (sqlrow[43] != NULL) memcpy(p2->GsnId,sqlrow[43],11); if (sqlrow[16] != NULL) memcpy(p2->CallDuration,sqlrow[16],12); if (sqlrow[1] != NULL) p2->FlagRead=atoi(sqlrow[1]); if (sqlrow[22] != NULL) memcpy(p2->RecordExtensions,sqlrow[22],LEN_RecordExtensions); if (sqlrow[27] != NULL) p2->ChargingCharacterSelectionMode=atoi(sqlrow[27]); if (sqlrow[14] != NULL) memcpy(p2->CellIdentity,sqlrow[14],24); if (sqlrow[15] != NULL) memcpy(p2->RecordOpenTime,sqlrow[15],LEN_DATETIME); if (sqlrow[17] != NULL) p2->SGSNChange=atoi(sqlrow[17]); if (sqlrow[26] != NULL) memcpy(p2->ChargingCharacteristics,sqlrow[26],LEN_ChargingCharacteristics); if (pInSzTableName != NULL) memcpy(p2->TableName, pInSzTableName, LEN_TABLENAME); /* snprintf(szSQL3, SQLMAX, "UPDATE %s SET FLAGREAD=1 WHERE SEQID='%s'", p2->TableName, p2->SeqId); mysql_real_query(myConnect, szSQL3, strlen(szSQL3)); */ } * pOutCDR = (struct S_OMCDR_LOAD*)sz; * nItems = nNumber; mysql_free_result(res_ptr); if (mysql_errno(myConnect)) { Unlock(); return -1; } Unlock(); return 0;}
?? 快捷鍵說(shuō)明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -