56,687
社区成员
发帖
与我相关
我的任务
分享
QueryDataset := TADODataSet.Create(nil);
with QueryDataset do
begin
Active := False;
AutoCalcFields := True;
CommandType := cmdText;
CommandTimeout := 30;
CacheSize := 1;
AutoCalcFields := True;
CursorLocation := clUseClient;
CursorType := ctKeyset;
EnableBCD := True;
Filtered := False;
Prepared := False;
LockType := ltOptimistic;
MarshalOptions := moMarshalAll;
StoreDefs := False;
Tag := 0;
connectionstring := '';
try
Connection := Conn;
except
on e:Exception do begin
Result := False;
end;
CommandText := 'Select * from table order by idx';
end;
while not QueryDataset.Eof do
begin
Inc(NumberOfQueryResult);
QueryDataset.Next();
end;
Freeandnil(QueryDataset);
mysql> select count(1) from iv_alert;
+----------+
| count(1) |
+----------+
| 1003 |
+----------+
1 row in set (0.00 sec)
mysql> desc iv_alert;
+--------------------------+---------------------+------+-----+---------------------+-----
| Field | Type | Null | Key | Default | Extr
+--------------------------+---------------------+------+-----+---------------------+-----
| uuid | bigint(20) | NO | UNI | NULL |
| state | smallint(6) | YES | MUL | NULL |
| markForDelete | char(1) | YES | | NULL |
| lastmodtime | timestamp | NO | | CURRENT_TIMESTAMP |
| lastModUserRef | char(32) | YES | | NULL |
| assignedUserRef | char(32) | YES | | NULL |
| sensorId | int(11) | NO | PRI | 0 |
| vsaId | int(11) | YES | | -1 |
| vidsId | int(11) | YES | | NULL |
| liId | int(11) | YES | | -1 |
| subscriberId1 | int(11) | YES | | NULL |
| subscriberId2 | int(11) | YES | | NULL |
| subscriberId3 | int(11) | YES | | NULL |
| subscriberId4 | int(11) | YES | | NULL |
| alertType | smallint(6) | NO | | NULL |
| categoryId | int(11) | YES | | NULL |
| subCategoryId | int(11) | YES | | NULL |
| detectionMechanism | int(11) | YES | | NULL |
| attackId | int(11) | NO | | NULL |
| creationTime | timestamp | NO | MUL | 0000-00-00 00:00:00 |
| emsReceivedTime | timestamp | NO | | 0000-00-00 00:00:00 |
| severity | tinyint(4) | NO | | NULL |
| alertDuration | int(11) | YES | | NULL |
| slotId | smallint(6) | NO | | NULL |
| portId | smallint(6) | NO | | NULL |
| alertCount | int(11) | YES | | NULL |
| packetLogId | bigint(20) | YES | | NULL |
| packetLogGrpId | bigint(20) | NO | | NULL |
| packetLogSeq | int(11) | YES | | NULL |
| lastByteReqStreamOffset | int(11) | YES | | NULL |
| lastByteRespStreamOffset | int(11) | YES | | NULL |
| hasPreviousBuffer | char(1) | YES | | NULL |
| signatureId | smallint(6) | YES | | NULL |
| ivProtocolId | int(11) | YES | | NULL |
| networkProtocolId | smallint(6) | YES | | NULL |
| sourceIPAddr | char(32) | YES | | NULL |
| sourcePort | int(11) | YES | | NULL |
| targetIPAddr | char(32) | YES | | NULL |
| targetPort | int(11) | YES | | NULL |
| confidence | tinyint(4) | YES | | NULL |
| protoQual1 | int(11) | YES | | NULL |
| protoQual2 | int(11) | YES | | NULL |
| protoParsingState | int(11) | YES | | NULL |
| direction | tinyint(4) | YES | | NULL |
| suppressedSigIds | int(11) | YES | | NULL |
| nidId | int(11) | YES | | NULL |
| firstAlarmTime | timestamp | NO | | 0000-00-00 00:00:00 |
| accumulateTime | int(11) | YES | | NULL |
| thresholdId | int(11) | YES | | NULL |
| observedValue | bigint(20) | YES | | NULL |
| thresholdValue | int(11) | YES | | NULL |
| thresholdDuration | int(11) | YES | | NULL |
| attackIdRef | char(20) | YES | | NULL |
| resultSetValue | int(11) | YES | | NULL |
| inlineDropAction | int(11) | YES | | NULL |
| relevance | char(1) | YES | | NULL |
| VLANId | int(11) | YES | | NULL |
| policyid | char(20) | YES | | NULL |
| hostIsolationState | tinyint(4) | NO | | NULL |
| mpeForwardState | tinyint(4) | NO | | NULL |
| mpeManagedStatus | tinyint(4) | YES | | NULL |
| mpeActiontStatus | tinyint(4) | YES | | NULL |
| mpeErrorcode | tinyint(4) | YES | | NULL |
| sensorAlertId | bigint(20) | NO | | NULL |
| sensorAlertUUID | bigint(20) | NO | PRI | NULL |
| sourceUserId | int(11) | YES | | NULL |
| destinationUserId | int(11) | YES | | NULL |
| sourceOSId | int(11) | YES | | NULL |
| destinationOSId | int(11) | YES | | NULL |
| sourceOSId1 | tinyint(3) unsigned | YES | | NULL |
| sourceOSId2 | tinyint(3) unsigned | YES | | NULL |
| sourceOSId3 | tinyint(3) unsigned | YES | | NULL |
| sourceOSId4 | tinyint(3) unsigned | YES | | NULL |
| destinationOSId1 | tinyint(3) unsigned | YES | | NULL |
| destinationOSId2 | tinyint(3) unsigned | YES | | NULL |
| destinationOSId3 | tinyint(3) unsigned | YES | | NULL |
| destinationOSId4 | tinyint(3) unsigned | YES | | NULL |
+--------------------------+---------------------+------+-----+---------------------+-----
77 rows in set (0.03 sec)
insert into iv_alert(uuid,state,sensorid,alerttype,attackid,severity,slotid,portid,packetLogGrpId,hostIsolationState,mpeForwardState,sensorAlertId,sensorAlertUUId) values(5409654708970783742,1,1004,1,4202751,1,1,2,0,0,0,0,501)