This problem occurs because the concatenation of SQL statements is too long to cause,
In general, Oracle SQL execution statements, English can not exceed 4000 characters, Chinese can not exceed 2000 characters, so once the content of the Clob field is more, there will be splicing of SQL
is too long to cause the problem to occur.
The simple workaround is to use a parameterized query to execute the SQL statement, the sample code is as follows
OracleConnection Con = new System.Data.OracleClient.OracleConnection (CONNECTSTR); try {decimal MsgId =; string insertsql = @ "INSERT into MSG (ID, TITLE, CONTENT, SORT, Time, AUTHOR, GROUP) VALUES (: ID, : TITLE,: CONTENT,: SORT, : Time,: AUTHOR,: GROUP) " ; Con.open (); OracleCommand cmd = new OracleCommand (Insertsql, Con); OracleParameter title = new OracleParameter ("title", Oracletype.nvarchar); OracleParameter content = new OracleParameter ("content", Oracletype.clob); OracleParameter gid = new OracleParameter ("GID", Oracletype.nvarchar); OracleParameter sort = new OracleParameter ("Sort", OracleType. number); OracleParameter time = new OracleParameter ("Time", oracletype.datetime); OracleParameter AUTHOR = new OracleParameter ("AUTHOR", Oracletype.nvarchar); OracleParameter Group = new OracleParameter ("group", Oracletype.nvarchar); TITLE. Value = Model.msgtitle; CONTENT. Value = Model.msgcontent;id.value = Guid.NewGuid (). ToString (); SORT. Value = MsgId; Time. Value = DateTime.Now; AUTHOR. Value = Model.msgauthor; GROUP. Value = Model.groupid; Cmd. Parameters.Add (Msgtitle); Cmd. Parameters.Add (msgcontent); Cmd. Parameters.Add (MSGID); Cmd. Parameters.Add (Msgsort); Cmd. Parameters.Add (Msgtime); Cmd. Parameters.Add (Msgauthor); Cmd. Parameters.Add (Mgsgroup); Cmd. ExecuteNonQuery (); Con.close (); } catch (Exception ex) {}