首页 > 代码库 > 【Oracle】给clob字段插入数据

【Oracle】给clob字段插入数据

// 插入

//OracleCommand cmd = "insertInto into GIS_PolygonPoint(PCode,PointColl) values(‘140134‘, :var)";

// 修改

//OracleCommand cmd = new OracleCommand("update yd_line set coord=:coordstr where lineid=" + LineId.ToString(), conn);

 

string sql = @"insert into 表 t(字段) values(:coordstr)";

OracleConnection conn = new OracleConnection(Comm.GetOracleConnStr());

OracleCommand cmd = new OracleCommand(sql, conn);

cmd.CommandType = CommandType.Text;

OracleParameter op = new OracleParameter(var, OracleType.Clob);

op.Value = http://www.mamicode.com/value;

cmd.Parameters.Add(op);

conn.Open();

cmd.ExecuteNonQuery();

conn.Close();