9.5 ODP.NET API for LOBs

Oracle Data Provider for .NET (ODP.NET) is an ADO.NET provider for the Oracle Database.

ODP.NET offers fast and reliable access to Oracle data and features from any .NET Core or .NET Framework application. ODP.NET also uses and inherits classes and interfaces available in the Microsoft .NET Class Library. The ODP.NET supports the following LOBs as native data types with .NET: BLOB, CLOB, NCLOB, and BFILE.

Table 9-7 ODP.NET methods in OracleClob and OracleBlob classes

Category Function/Procedure Description
Open/Close BeginChunkWrite Open a LOB
EndChunkWrite Close a LOB
IsInChunkWriteMode Check if a LOB is open
Read Operations Length Get the length of the LOB
OptimumChunkSize Get the optimum read/write size
Value Returns the entire LOB data as a string for CLOB and a byte array for BLOB
Read Read data from the LOB starting at the specified offset
Search Return the matching position of a pattern in a LOB using INSTR
Modify Operations Write Write data to the LOB at a specified offset
Erase Erase part of a LOB, starting at a specified offset
SetLength Trim the LOB value to the specified shorter length
Operations involving multiple locators Compare Compare all or part of the value of two LOBs
IsEqual Check if two LOBs point to the same LOB data
Append Append a LOB value to another LOB, or append a byte array, string, or character array to an existing LOB
CopyTo Copy all or part of a LOB to another LOB
Clone Assign LOB locator src to LOB locator dst