I have a simple question about dapper with Oracle database, when I was trying to insert a large size of string into oracle clob, it throws exception says:
Specified argument was out of the range of valid values.
then I was trying to modify this part
param.Add(name: "body", value: obj.BODY, direction: ParameterDirection.Input);
I can't specify
What should I change to make it work?
Its works for me...
byte newvalue = System.Text.Encoding.Unicode.GetBytes(mystring); var clob = new OracleClob(db); clob.Write(newvalue, 0, newvalue.Length); var parameter = new OracleDynamicParameters(); parameter.Add("PCLOB", clob); var command = @"Insert into MYTABLE(CLOBFIELD) values (:PCLOB)"; var t = db.Execute(command, parameter);
You could get OracleDynamicParameters class in https://gist.github.com/vijaysg/3096151