当前位置: 编程技术>.net/c#/asp.net
C#操作CLOB大对象的代码一例
来源: 互联网 发布时间:2014-08-30
本文导语: 代码如下: 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=...
代码如下:
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. 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(); }