zoukankan      html  css  js  c++  java
  • C#实现Oracle数据库插入clob字段类型数据

    public static void InsertWithLob(OracleConnection conn)
            {
                if (conn!= null && conn.State == ConnectionState.Open)
                {
                    try
                    {
                        string sqlText = "insert into tb_nclob(id,name,text) values(1,'test',:text)";
                        using (OracleCommand cmd = new OracleCommand(sqlText, conn))
                        {
                            OracleParameter oracleParameter = new OracleParameter("text", OracleType.Clob);
                            oracleParameter.Value = "this is my test";
                            cmd.Parameters.Add(oracleParameter);
                            int rows = cmd.ExecuteNonQuery();

             cmd.Parameters.Clear();
                            return rows;
                        }
                    }
                    catch (OracleException ex)
                    {
                        throw new Exception(ex.Message);
                    }
                }
            }

    love life,love work!---身为屌丝,向往的仍然是逆袭的故事。
  • 相关阅读:
    C 文件随机读写
    fread(),fwrite()函数
    C 将文本文件内容逆序打印
    C++ 文件复制
    关机效果
    xpath的语法
    ajax json 数据
    转帖 ASP.NET中高级程序员 面试题
    数据库查询的执行顺序
    【转载】母版页引用外部文件的路径问题
  • 原文地址:https://www.cnblogs.com/liushenghuan/p/5740305.html
Copyright © 2011-2022 走看看