求助,写的程序帮忙看下
string sql4 = string.Empty;sql4 = @"select device.id from device, event1 where device.IDENTIFY=event1.MC_HOST_ADDRESS and device.TYPE=event1.MC_ORIGIN_CLASS and device.OBJECT =event1.MC_OBJECT_OWNER and device.TYPE='服务器'
union all
select device.id from device, event1 where device.IDENTIFY=event1.MC_HOST_ADDRESS and device.TYPE=event1.MC_ORIGIN_CLASS and device.OBJECT =event1.MC_OBJECT_OWNER and device.SUBOBJECT=event1.MC_OBJECT and device.TYPE='数据库'
union all
select device.id from device, event1 where device.IDENTIFY=event1.MC_HOST_ADDRESS and device.TYPE=event1.MC_ORIGIN_CLASS and device.OBJECT =event1.MC_OBJECT_OWNER and device.SUBOBJECT=event1.MC_OBJECT and device.TYPE='中间件' ";
oc.ExecuteReader(sql4);
// int "+id+" = oc.ExecuteReader(sql4);
if( "+id+" != null)
{ string sql5 = string.Empty;
sql5=@"insert into alert (alert.id,alert.eventid,alert.deviceid,alert.status,alert.parameter,alert.value,alert.severity,alert.msg,alert.ticketid,alert.ticketstatus,alert.timestamp,alert.createtime,alert.lastmodifiedtime) values ('9999',event1.mc_tool_sev,
'+id+',event1.status,event1.MC_PARAMETER,event1.mc_parameter_value,'2',event1.msg,event1.mc_object_uri,event1.mc_service,event1.MC_INCIDENT_TIME,event1.MC_ARRIVAL_TIME,event1.DATE_RECEPTION)";
oc.ExecuteReader(sql5);
}
else;
{
return;
}