Article ID: 322796 - View products that this article applies to.
This article was previously published under Q322796
This step-by-step article describes how to use the .NET Managed Provider for Oracle to pass OracleType.Blob as an Input parameter to an Oracle stored procedure.
RequirementsThe following list outlines the recommended hardware, software, network infrastructure, and service packs that are required:
.NET Managed Provider for OracleThis article assumes that you are familiar with the following topics:
Create the Oracle tablesThis sample uses tables that are defined in the Oracle Scott/Tiger schema. By default, the Oracle Scott/Tiger schema is included with a standard Oracle installation.
If this schema does not exist, you must run the following table script for the tables:
Create the Oracle packagesCreate the following Oracle package on the Oracle server:
Create the following Oracle package body on the Oracle server:
Create the Visual Basic .NET application
Additional informationIf the column in the table is specified as a "Blob" type, as it is in this scenario, Oracle only accepts a Blob type parameter. You cannot create a Binary Large Object (BLOB) from a byte array. Therefore, the code sample contains the following code:
This code has Oracle create a BLOB and pass the BLOB back as a parameter to the command object. The command object is then assigned to the "TempLob" variable, which is declared as OracleLob.
The OracleTransaction is required by Oracle when modifying any LOB. If you do not have a transaction, you receive the following exception:
An unhandled exception of type 'System.InvalidOperationException' occurred in system.data.oracleclient.dll
Additional information: Modifying a LOB requires that the connection be transacted.
For more information about a similar topic using Visual Basic 6.0, click the following article number to view the article in the Microsoft Knowledge Base:
185958For more information, click the following article number to view the article in the Microsoft Knowledge Base:
(http://support.microsoft.com/kb/185958/ )How to use ADO GetChunk/AppendChunk with Oracle for BLOB data
321718The third-party products that this article discusses are manufactured by companies that are independent of Microsoft. Microsoft makes no warranty, implied or otherwise, regarding the performance or reliability of these products.
(http://support.microsoft.com/kb/321718/ )How to call Oracle stored procedures in Visual Basic .NET with the Microsoft Oracle Managed Provider
Article ID: 322796 - Last Review: October 4, 2005 - Revision: 4.2