代码如下:
string filename = dirPath + "告警经验库信息.txt"; OracleConnection ocon = new System.Data.OracleClient.OracleConnection("data source=orcl;user id=ifms;pwd=ifms;"); ocon.Open(); OracleCommand ocmd = new OracleCommand("select count(*) from alarmcause t where t.vendor='ZY0801' and (experience is null or dbms_lob.compare(experience, empty_clob()) = 0) and t.probablecause='" + zhCause + "'", ocon); int count = int.Parse(ocmd.ExecuteScalar().ToString()); ocon.Close(); //http://www.jb200.com if (count > 0) { ocon.Open(); ocmd = new OracleCommand("update alarmcause set experience=:exper where vendor='ZY0801' and probablecause='" + zhCause + "'", ocon); OracleParameter op = new OracleParameter("exper", OracleType.Clob); op.Value = strhtml; ocmd.Parameters.Add(op); ocmd.ExecuteNonQuery(); ocon.Close(); }