Article ID: 322796 - Last Review: October 4, 2005 - Revision: 4.2 How to pass a BLOB as a parameter to an Oracle package by using the .NET Managed Provider for OracleThis article was previously published under Q322796 On This PageSUMMARY 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 Oracle This article assumes that you are familiar with the following
topics:
http://www.microsoft.com/downloads/details.aspx?FamilyID=4F55D429-17DC-45EA-BFB3-076D1C052524&displaylang=en (http://www.microsoft.com/downloads/details.aspx?FamilyID=4F55D429-17DC-45EA-BFB3-076D1C052524&displaylang=en)
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 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: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. REFERENCES
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:
185958
(http://support.microsoft.com/kb/185958/
)
How to use ADO GetChunk/AppendChunk with Oracle for BLOB data
For more information, click the following article number to view the article in the Microsoft Knowledge Base:
321718
(http://support.microsoft.com/kb/321718/
)
How to call Oracle stored procedures in Visual Basic .NET with the Microsoft Oracle Managed Provider
The 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.
| Article Translations
|
Back to the top
