My SQL statement works fine in my admin tool, but when I run the script I don't get an error but the insert does not go through. Any ideas? I am 2 days old to this.
**********Script**********
#logging.debug("Inserting to DB")
try:
print fullSQL
conn.query(fullSQL)
fileRecordCount+=1
print "done"
except:
logging.critical("Unable to insert the following SQL: " + fullSQL)
logging.error(traceback.print_exc(file=sys.stdout))
...
try:
conn = MySQLdb.connect(host="localhost",user="root",passwd="",db="callmanager")
except:
# Ooops... couldn't connect
logging.critical("Unable to connect to the database. Terminating..")
logging.error(traceback.print_exc(file=sys.stdout))
sys.exit(2)
**********SQL**********
INSERT INTO calldetails (cdrRecordType,globalCallID_callManagerId,globalCallID_callId,origLegCallIdentifier,dateTimeOrigination,origNodeId,origSpan,origIpAddr,callingPartyNumber,callingPartyUnicodeLoginUserID,origCause_location,origCause_value,origPrecedenceLevel,origMediaTransportAddress_IP,origMediaTransportAddress_Port,origMediaCap_payloadCapability,origMediaCap_maxFramesPerPacket,origMediaCap_g723BitRate,origVideoCap_Codec,origVideoCap_Bandwidth,origVideoCap_Resolution,origVideoTransportAddress_IP,origVideoTransportAddress_Port,destLegIdentifier,destNodeId,destSpan,destIpAddr,originalCalledPartyNumber,finalCalledPartyNumber,finalCalledPartyUnicodeLoginUserID,destCause_location,destCause_value,destPrecedenceLevel,destMediaTransportAddress_IP,destMediaTransportAddress_Port,destMediaCap_payloadCapability,destMediaCap_maxFramesPerPacket,destMediaCap_g723BitRate,destVideoCap_Codec,destVideoCap_Bandwidth,destVideoCap_Resolution,destVideoTransportAddress_IP,destVideoTransportAddress_Port,dateTimeConnect,dateTimeDisconnect,lastRedirectDn,pkid,originalCalledPartyNumberPartition,callingPartyNumberPartition,finalCalledPartyNumberPartition,lastRedirectDnPartition,duration,origDeviceName,destDeviceName,origCallTerminationOnBehalfOf,destCallTerminationOnBehalfOf,origCalledPartyRedirectOnBehalfOf,lastRedirectRedirectOnBehalfOf,origCalledPartyRedirectReason,lastRedirectRedirectReason,destConversationId,globalCallId_ClusterID,joinOnBehalfOf,comment,authCodeDescription,authorizationLevel,clientMatterCode,callSecuredStatus,origConversationId) VALUES (1,2,2248012,47589994,1270098024,2,23,-1760880212,'8174262476','\ ',0,0,4,-1760111212,17428,4,20,0,0,0,0,0,0,47111995,2,0,-1911809782,'24715','24715','\ ',0,16,4,-1911111782,17664,4,20,0,0,0,0,0,0,1270098030,1270098050,'24715','a47c3258-a8d5-4f3c-be42-10060d0728f1','P_MPPC_GU','','P_MPPC_GU','P_MPPC_GU',20,'S0/SU0/DS1-0@mppc.vgw03','SEP0021112495DC',0,12,0,0,0,0,0,'StandAloneCluster',0,'','',0,'',0,0
);
**********Script**********
#logging.debug("Inserting to DB")
try:
print fullSQL
conn.query(fullSQL)
fileRecordCount+=1
print "done"
except:
logging.critical("Unable to insert the following SQL: " + fullSQL)
logging.error(traceback.print_exc(file=sys.stdout))
...
try:
conn = MySQLdb.connect(host="localhost",user="root",passwd="",db="callmanager")
except:
# Ooops... couldn't connect
logging.critical("Unable to connect to the database. Terminating..")
logging.error(traceback.print_exc(file=sys.stdout))
sys.exit(2)
**********SQL**********
INSERT INTO calldetails (cdrRecordType,globalCallID_callManagerId,globalCallID_callId,origLegCallIdentifier,dateTimeOrigination,origNodeId,origSpan,origIpAddr,callingPartyNumber,callingPartyUnicodeLoginUserID,origCause_location,origCause_value,origPrecedenceLevel,origMediaTransportAddress_IP,origMediaTransportAddress_Port,origMediaCap_payloadCapability,origMediaCap_maxFramesPerPacket,origMediaCap_g723BitRate,origVideoCap_Codec,origVideoCap_Bandwidth,origVideoCap_Resolution,origVideoTransportAddress_IP,origVideoTransportAddress_Port,destLegIdentifier,destNodeId,destSpan,destIpAddr,originalCalledPartyNumber,finalCalledPartyNumber,finalCalledPartyUnicodeLoginUserID,destCause_location,destCause_value,destPrecedenceLevel,destMediaTransportAddress_IP,destMediaTransportAddress_Port,destMediaCap_payloadCapability,destMediaCap_maxFramesPerPacket,destMediaCap_g723BitRate,destVideoCap_Codec,destVideoCap_Bandwidth,destVideoCap_Resolution,destVideoTransportAddress_IP,destVideoTransportAddress_Port,dateTimeConnect,dateTimeDisconnect,lastRedirectDn,pkid,originalCalledPartyNumberPartition,callingPartyNumberPartition,finalCalledPartyNumberPartition,lastRedirectDnPartition,duration,origDeviceName,destDeviceName,origCallTerminationOnBehalfOf,destCallTerminationOnBehalfOf,origCalledPartyRedirectOnBehalfOf,lastRedirectRedirectOnBehalfOf,origCalledPartyRedirectReason,lastRedirectRedirectReason,destConversationId,globalCallId_ClusterID,joinOnBehalfOf,comment,authCodeDescription,authorizationLevel,clientMatterCode,callSecuredStatus,origConversationId) VALUES (1,2,2248012,47589994,1270098024,2,23,-1760880212,'8174262476','\ ',0,0,4,-1760111212,17428,4,20,0,0,0,0,0,0,47111995,2,0,-1911809782,'24715','24715','\ ',0,16,4,-1911111782,17664,4,20,0,0,0,0,0,0,1270098030,1270098050,'24715','a47c3258-a8d5-4f3c-be42-10060d0728f1','P_MPPC_GU','','P_MPPC_GU','P_MPPC_GU',20,'S0/SU0/DS1-0@mppc.vgw03','SEP0021112495DC',0,12,0,0,0,0,0,'StandAloneCluster',0,'','',0,'',0,0
);