orcl clob 数据插入报错处理_test

  begin
DECLARE REALLYBIGTEXTSTRING  CLOB := '待插入的海量字符串';
BEGIN
INSERT INTO oplog(ssql)VALUES(  REALLYBIGTEXTSTRING  );commit;
end ;
end;

 

------------------------------------------------------------------------------------------------------------------------------------------------------------

string strUpdate = "update equipsvgs set content=:content where equipId=:equipId ";
                OracleCommand mycmd = new OracleCommand(strUpdate);
                mycon.Open();
                mycmd.Connection = mycon;
                OracleParameter pa1 = new OracleParameter(":content", OracleDbType.Varchar2);
                pa1.Value = equipsvg.Content;
                OracleParameter pa2 = new OracleParameter(":equipId", OracleDbType.Long);
                pa2.Value = equipsvg.EquipId;
                mycmd.Parameters.Add(pa1);
                mycmd.Parameters.Add(pa2);

                mycmd.ExecuteNonQuery();

                mycon.Close();

------------------------------------------------------------------------------------------------------------------------------------------------------------

 

        public static void InClob(string REALLYBIGTEXTSTRING)
        {

            string sql = "INSERT INTO oplog(ssql)VALUES(  :REALLYBIGTEXTSTRING  )";//存储过程名称
            //参数
            OracleParameter[] parameters =  {
                new OracleParameter(":REALLYBIGTEXTSTRING", OracleType.Clob)
              
            };
            parameters[0].Value = REALLYBIGTEXTSTRING;//输入参数赋值
            DBHelper.ExecuteNonQuery(CommandType.Text, sql, parameters);

            //DataTable dt = getDataTable(sql, parameters, true);//获取数据 获取非存储过程  getDataTable(sql, null, false)
            ////dt.Load(daReader);
            //DataRow dr = dt.Rows[0];

            //string s = dr["smsg"].ToString();

        }

 

---  test ok

 

查询问题

http://www.orafaq.com/forum/t/68177/0/
http://www.orafaq.com/forum/t/85283/0/

明天看

------------------------------------------------------------------------------------------------------------------------------------------------------------

你可能感兴趣的:(orcl clob 数据插入报错处理_test)