SQL/LOB: Piecewise Writes and Reads of LOBs (Doc ID 50910.1)

Last updated on OCTOBER 25, 2010

Applies to:

Oracle Server - Enterprise Edition - Version: 8.0.3.0 to 11.2.0.1 - Release: 8.0.3 to 11.2
Oracle Server - Personal Edition - Version: 8.0.3.0 to 11.2.0.1   [Release: 8.0.3 to 11.2]
Oracle Server - Standard Edition - Version: 8.0.3.0 to 11.2.0.1   [Release: 8.0.3 to 11.2]
Information in this document applies to any platform.

Goal


This OCI program inserts a row into a BLOB using piecewise operations, currently with buffering enabled.
It also gives instructions for piecewise operations without buffering. Once the row has been inserted it is read back in pieces. In both the read and write no callback functions are used - the read and write functions are simply repeatedly called while OCI_NEED_DATA is returned.

The application needs the following table to be created:


SQL>create table lob_tab (c1 number, c2 blob);



Note type casts have been used on all the OCI calls, even when not required, simply to provide a clearer example.

Solution

Sign In with your My Oracle Support account

Don't have a My Oracle Support account? Click to get started

My Oracle Support provides customers with access to over a
Million Knowledge Articles and hundreds of Community platforms