[Mono-dev] Oracle LOB help

Jorge Landrián Garcia landrian at gmail.com
Sun Oct 8 11:06:04 EDT 2006


I read the post "[Mono-devel-list] System.Data.OracleClient and CLOB's", and
I would like to ask you if exist a way in mono, to insert a lob without
inserting first an empty_clob, the next code work in .NET but I can't make
it work in mono

OracleConnection conn = new OracleConnection("server=MyServer; integrated
security=yes;");
conn.Open();
OracleTransaction tx = conn.BeginTransaction();
OracleCommand cmd = conn.CreateCommand();
cmd.Transaction = tx;
cmd.CommandText = "declare xx blob; begin dbms_lob.createtemporary(xx,
false, 0); :tempblob := xx; end;";
cmd.Parameters.Add(new OracleParameter("tempblob", OracleType.Blob)).Direction
= ParameterDirection.Output;
cmd.ExecuteNonQuery();
OracleLob tempLob = (OracleLob)cmd.Parameters[0].Value;
tempLob.BeginBatch(OracleLobOpenMode.ReadWrite);
tempLob.Write(tempbuff,0,tempbuff.Length);
tempLob.EndBatch();
cmd.Parameters.Clear();
cmd.CommandText = "myTable.myProc";
cmd.CommandType = CommandType.StoredProcedure;
cmd.Parameters.Add(new OracleParameter("ImportDoc", OracleType.Blob)).Value
= tempLob;
cmd.ExecuteNonQuery();
tx.Commit();

it is from MSDN.

I realy appreciate any help from you.

sorry because my english, I speak spanish.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.ximian.com/pipermail/mono-devel-list/attachments/20061008/9fc9d590/attachment.html 


More information about the Mono-devel-list mailing list