![]() If that is not the case, ODP.NET raises an exception when the command is executed. For example, the ODP.NET LOB Connection property must reference the same connection as the OracleCommand object if the ODP.NET LOB object is a parameter of the OracleCommand. In addition, the ODP.NET LOB types object can be used only within the context of the same OracleConnection referenced by the ODP.NET LOB object. The ODP.NET LOB object Connection property is read-only and cannot be changed during its lifetime. If a LOB object is obtained by invoking an ODP.NET LOB object constructor to create a temporary LOB, the Connection property is set with a reference to the OracleConnection object provided in the constructor. If a LOB object is obtained as an output parameter, then its Connection property is set with a reference to the same OracleConnection property used by the OracleCommand object. If an ODP.NET LOB object is obtained from an OracleDataReader object through a typed accessor, then its Connection property is set with a reference to the same OracleConnection object used by the OracleDataReader object. If the connection associated with a LOB object is closed, then the LOB object is not usable and should be disposed of. To close a previously opened BFILE, use the CloseFile method.Įvery ODP.NET LOB object is a connected object and requires a connection during its lifetime. An OracleBFile object must be explicitly opened using the OpenFile method before any data can be read from it. The Read method that takes a char as the buffer populates it with Unicode characters.Īdditional methods can also be found on the OracleBFile object. The Read method that takes a byte as the buffer populates it with CLOB data as Unicode byte array. The OracleClob object overloads the Read method, providing two ways to read data from a CLOB. Therefore, each read or write request incurs a database round-trip. Data is not cached in the LOB objects when read and write operations are carried out. The LOB data (except for BFILE types) can be updated using the ODP.NET LOB objects by using methods such as Write. NET Stream class to provide generic Stream operations. The ODP.NET LOB objects can be obtained by calling the proper typed accessor on the OracleDataReader object, or by calling the proper typed accessor as an output parameter on a command execution with the proper bind type.Īll ODP.NET LOB objects inherit from the. Table 3-19 ODP.NET LOB Objects Oracle LOB Type
0 Comments
Leave a Reply. |