Not sure if this will help you or not, but I needed to pull a BLOB back into a byte array to write it to a file. What I did was to pull the BLOB back from the database in a DataReader and use GetBytes. The code below works for me, though it is not using
a stored proc.
using Microsoft.Practices.EnterpriseLibrary.Data.Oracle;
using System;
using System.Data;
OracleDatabase db = new OracleDatabase(connectionString);
IDataReader dataReader = db.ExecuteReader(CommandType.Text, sqlString);
dataReader.Read();
long blobLength = dataReader.GetBytes(0, 0, null, 0, 0);
byte[] writeBuffer = new byte[blobLength];
dataReader.GetBytes(0, 0, writeBuffer, 0, (int)blobLength);
So now the BLOB is in a byte array and can be written out to a file or hopefully whatever you need. FYI, the GetBytes concept came from
Michal Kozusznik's post. Hope this works for you.
None
0 Points
1 Post
Retrieving a blob from Oracle using MS Enterprise Library 3.1
Mar 05, 2008 08:37 AM|jon211|LINK
I currently have an Oracle stored procedure that returns a blob.
We're using MS Enterprise Library 3.1 to connect to the database and I can't find any support for lobs at all.
Anyone know if this is possible using the enterprise library?
oracle blob enterprise library
None
0 Points
1 Post
Re: Retrieving a blob from Oracle using MS Enterprise Library 3.1
Apr 16, 2008 01:51 PM|dungbomb|LINK
Not sure if this will help you or not, but I needed to pull a BLOB back into a byte array to write it to a file. What I did was to pull the BLOB back from the database in a DataReader and use GetBytes. The code below works for me, though it is not using a stored proc.
So now the BLOB is in a byte array and can be written out to a file or hopefully whatever you need. FYI, the GetBytes concept came from Michal Kozusznik's post. Hope this works for you.