Oracle inserts a CLOB field of over 4000 bytes. You can create a separate OracleCommand to insert the specified clob field. Here, we only describe how to insert CLOB data, blob is similar to this. We will not introduce it here. The following two methods are described:
In an application that inserts data using SQL statements in a group, we may encounter the need to insert large data, for example, when we need to insert fields with more than 4000 bytes in oracle, if we use a simple grouping SQL statement to insert the fields, we will obviously encounter problems, this restriction is not imposed on SQL server. I tried to execute a-character SQL statement in SQL server and still can insert data, however, if you insert more than 4000 characters in oracle, an exception is reported. The following is a summary of the solution to this problem: we can create a separate OracleCommand to insert the specified data successfully. Here we only introduce how to insert clob data, blob is similar to this. We will not introduce it here. The following two methods have been verified: string conn = "Data Source = connection string specified by the client; User ID = user; password = mima "; OracleConnection Con = new System. data. oracleClient. oracleConnection (conn); Con. open (); string jsontext = "insert into gwexpointlist (id, name, content) VALUES (1, 'name',: clob)"; OracleCommand cmd = new OracleCommand (jsontext, con); OracleParameter op = new OracleParameter ("clob", OracleType. clob); op. value = "super-normal string with more than 4000 characters"; cmd. parameters. add (op); cmd. executeNonQuery (); Con. close ();