Page 1 of 1

oradirect3 (for 1.1) bug2 : cant receive BLOB via proc

Posted: Tue 14 Jun 2005 04:20
by expas
we have table t_testblob with two fields: [blb] of type BLOB with any content (simple string for example) and [id] number :)

Oracle proc:

Code: Select all

create or replace procedure test_blob(p_blb out blob)
is
begin
  SELECT blb INTO p_blb FROM t_testblob b
	WHERE b.id = 1;
  EXCEPTION
 	WHEN OTHERS THEN
		p_blb := NULL;
end test_blob;
code in dotnet:

Code: Select all

OracleCommand cmd = new OracleCommand("test_blob", (OracleConnection)_cnn);
cmd.CommandType = CommandType.StoredProcedure;
OracleParameter p = new OracleParameter("blb", OracleDbType.Blob);
p.Direction = ParameterDirection.Output;
cmd.Parameters.Add(p);

cmd.ExecuteNonQuery();
byte[] lob0 = (byte[])cmd.Parameters["blb"].Value;
it crash on cmd.ExecuteNonQuery() with message:
An unhandled exception of type 'System.InvalidCastException' occurred in corelab.oracle.dll

Additional information: Specified cast is not valid.
(if try receive BLOB via simple select all work, but via proc it dosnt work)

Posted: Fri 17 Jun 2005 13:25
by Oleg
We reproduced your problems and now we are working on solving them.
These fixes will be included in the next build that will be in a week.
Please see announcements at the forum to get know when a new build is released.