OCILIB (C and C++ Driver for Oracle)  4.9.0
Open source and cross platform Oracle Driver delivering efficient access to Oracle databases.
Loading...
Searching...
No Matches
Internal Large Objects (LOBs)

Detailed Description

OcilibCApiStatementControl

Large Objects (LOBs) were introduced with Oracle 8i to replace LONGs.

Oracle OCI supplies a set of APIs to manipulate this data type.

OCILIB encapsulates this API by supplying:

OCILIB currently supports 3 types of LOBs:

OCI_Lob objects can be:

LOBs > 4 GB

Oracle 10g extended LOBs by increasing the maximum size from 4 GB to 128 TB.

OCILIB, since version 2.1.0, supports this new limit. For handling sizes and offsets up to 128 TB, 64-bit integers are required.

A scalar integer type has been introduced: big_uint (formerly lobsize_t). This type can be a 32-bit or 64-bit integer depending on:

big_uint will be a 64-bit integer:

Example
#include "ocilib.h"
/* requires script demo/lob.sql */
#define SIZE_BUF 512
void err_handler(OCI_Error *err)
{
printf("%s\n", OCI_ErrorGetString(err));
}
int main(void)
{
OCI_Lob *lob1, *lob2;
char temp[SIZE_BUF + 1];
size_t n;
if (!OCI_Initialize(err_handler, NULL, OCI_ENV_DEFAULT))
{
return EXIT_FAILURE;
}
cn = OCI_ConnectionCreate("db", "usr", "pwd", OCI_SESSION_DEFAULT);
OCI_ExecuteStmt(st, "select code, obj from large_objects for update");
rs = OCI_GetResultset(st);
while (OCI_FetchNext(rs))
{
char *str = "- ABC must have replaced 3 first chars";
lob1 = OCI_GetLob(rs, 2);
lob2 = OCI_LobCreate(cn, OCI_CLOB);
n = OCI_LobWrite(lob1, "ABC", 3);
OCI_LobSeek(lob1, n, OCI_SEEK_SET);
n = OCI_LobWrite(lob2, str, (unsigned int) strlen(str));
OCI_LobAppendLob(lob1, lob2);
OCI_LobSeek(lob1, 0, OCI_SEEK_SET);
n = OCI_LobRead(lob1, temp, SIZE_BUF);
temp[n] = 0;
printf("code: %i, obj : %s\n", OCI_GetInt(rs, 1), temp);
OCI_LobFree(lob2);
}
printf("\n%d row(s) fetched\n", OCI_GetRowCount(rs));
return EXIT_SUCCESS;
}
OCI_SYM_PUBLIC boolean OCI_API OCI_ConnectionFree(OCI_Connection *con)
Close a physical connection to an Oracle database server.
OCI_SYM_PUBLIC OCI_Connection *OCI_API OCI_ConnectionCreate(const otext *db, const otext *user, const otext *pwd, unsigned int mode)
Create a physical connection to an Oracle database server.
struct OCI_Connection OCI_Connection
Oracle physical connection.
Definition: types.h:124
struct OCI_Statement OCI_Statement
Oracle SQL or PL/SQL statement.
Definition: types.h:136
struct OCI_Error OCI_Error
Encapsulates an Oracle or OCILIB exception.
Definition: types.h:410
struct OCI_Lob OCI_Lob
Oracle Internal Large objects:
Definition: types.h:198
struct OCI_Resultset OCI_Resultset
Collection of output columns from a select statement.
Definition: types.h:163
OCI_SYM_PUBLIC const otext *OCI_API OCI_ErrorGetString(OCI_Error *err)
Retrieve the error message string from an error handle.
OCI_SYM_PUBLIC OCI_Lob *OCI_API OCI_GetLob(OCI_Resultset *rs, unsigned int index)
Return the current lob value of the column at the given index in the result set.
OCI_SYM_PUBLIC boolean OCI_API OCI_FetchNext(OCI_Resultset *rs)
Fetch the next row of the result set.
OCI_SYM_PUBLIC unsigned int OCI_API OCI_GetRowCount(OCI_Resultset *rs)
Retrieve the number of rows fetched so far.
OCI_SYM_PUBLIC OCI_Resultset *OCI_API OCI_GetResultset(OCI_Statement *stmt)
Retrieve the result set handle from an executed statement.
OCI_SYM_PUBLIC int OCI_API OCI_GetInt(OCI_Resultset *rs, unsigned int index)
Return the current integer value of the column at the given index in the result set.
OCI_SYM_PUBLIC boolean OCI_API OCI_Cleanup(void)
Clean up all resources allocated by the library.
OCI_SYM_PUBLIC boolean OCI_API OCI_Initialize(POCI_ERROR err_handler, const otext *lib_path, unsigned int mode)
Initialize the library.
OCI_SYM_PUBLIC unsigned int OCI_API OCI_LobWrite(OCI_Lob *lob, void *buffer, unsigned int len)
[OBSOLETE] Write a buffer into a LOB
OCI_SYM_PUBLIC boolean OCI_API OCI_LobFree(OCI_Lob *lob)
Free a local temporary lob.
OCI_SYM_PUBLIC OCI_Lob *OCI_API OCI_LobCreate(OCI_Connection *con, unsigned int type)
Create a local temporary Lob instance.
OCI_SYM_PUBLIC unsigned int OCI_API OCI_LobRead(OCI_Lob *lob, void *buffer, unsigned int len)
[OBSOLETE] Read a portion of a lob into the given buffer
OCI_SYM_PUBLIC boolean OCI_API OCI_LobAppendLob(OCI_Lob *lob, OCI_Lob *lob_src)
Append a source LOB at the end of a destination LOB.
OCI_SYM_PUBLIC boolean OCI_API OCI_LobSeek(OCI_Lob *lob, big_uint offset, unsigned int mode)
Perform a seek operation on the OCI_lob content buffer.
OCI_SYM_PUBLIC OCI_Statement *OCI_API OCI_StatementCreate(OCI_Connection *con)
Create a statement object and return its handle.
OCI_SYM_PUBLIC boolean OCI_API OCI_ExecuteStmt(OCI_Statement *stmt, const otext *sql)
Prepare and execute a SQL statement or PL/SQL block in a single call.
OCI_SYM_PUBLIC boolean OCI_API OCI_StatementFree(OCI_Statement *stmt)
Free a statement and all resources associated with it (result sets, bind variables,...

Functions

OCI_SYM_PUBLIC OCI_Lob *OCI_API OCI_LobCreate (OCI_Connection *con, unsigned int type)
 Create a local temporary Lob instance.
 
OCI_SYM_PUBLIC boolean OCI_API OCI_LobFree (OCI_Lob *lob)
 Free a local temporary lob.
 
OCI_SYM_PUBLIC OCI_Lob **OCI_API OCI_LobArrayCreate (OCI_Connection *con, unsigned int type, unsigned int nbelem)
 Create an array of LOB objects.
 
OCI_SYM_PUBLIC boolean OCI_API OCI_LobArrayFree (OCI_Lob **lobs)
 Free an array of LOB objects.
 
OCI_SYM_PUBLIC unsigned int OCI_API OCI_LobGetType (OCI_Lob *lob)
 Return the type of the given Lob object.
 
OCI_SYM_PUBLIC boolean OCI_API OCI_LobSeek (OCI_Lob *lob, big_uint offset, unsigned int mode)
 Perform a seek operation on the OCI_lob content buffer.
 
OCI_SYM_PUBLIC big_uint OCI_API OCI_LobGetOffset (OCI_Lob *lob)
 Return the current position in the Lob content buffer.
 
OCI_SYM_PUBLIC unsigned int OCI_API OCI_LobRead (OCI_Lob *lob, void *buffer, unsigned int len)
 [OBSOLETE] Read a portion of a lob into the given buffer
 
OCI_SYM_PUBLIC boolean OCI_API OCI_LobRead2 (OCI_Lob *lob, void *buffer, unsigned int *char_count, unsigned int *byte_count)
 Read a portion of a lob into the given buffer.
 
OCI_SYM_PUBLIC unsigned int OCI_API OCI_LobWrite (OCI_Lob *lob, void *buffer, unsigned int len)
 [OBSOLETE] Write a buffer into a LOB
 
OCI_SYM_PUBLIC boolean OCI_API OCI_LobWrite2 (OCI_Lob *lob, void *buffer, unsigned int *char_count, unsigned int *byte_count)
 Write a buffer into a LOB.
 
OCI_SYM_PUBLIC boolean OCI_API OCI_LobTruncate (OCI_Lob *lob, big_uint size)
 Truncate the given LOB to a shorter length.
 
OCI_SYM_PUBLIC big_uint OCI_API OCI_LobGetLength (OCI_Lob *lob)
 Return the actual length of a LOB.
 
OCI_SYM_PUBLIC unsigned int OCI_API OCI_LobGetChunkSize (OCI_Lob *lob)
 Return the chunk size of a LOB.
 
OCI_SYM_PUBLIC big_uint OCI_API OCI_LobErase (OCI_Lob *lob, big_uint offset, big_uint len)
 Erase a portion of the LOB at a given position.
 
OCI_SYM_PUBLIC unsigned int OCI_API OCI_LobAppend (OCI_Lob *lob, void *buffer, unsigned int len)
 Append a buffer at the end of a LOB.
 
OCI_SYM_PUBLIC boolean OCI_API OCI_LobAppend2 (OCI_Lob *lob, void *buffer, unsigned int *char_count, unsigned int *byte_count)
 Append a buffer at the end of a LOB.
 
OCI_SYM_PUBLIC boolean OCI_API OCI_LobAppendLob (OCI_Lob *lob, OCI_Lob *lob_src)
 Append a source LOB at the end of a destination LOB.
 
OCI_SYM_PUBLIC boolean OCI_API OCI_LobIsTemporary (OCI_Lob *lob)
 Check if the given LOB is a temporary LOB.
 
OCI_SYM_PUBLIC boolean OCI_API OCI_LobCopy (OCI_Lob *lob, OCI_Lob *lob_src, big_uint offset_dst, big_uint offset_src, big_uint count)
 Copy a portion of a source LOB into a destination LOB.
 
OCI_SYM_PUBLIC boolean OCI_API OCI_LobCopyFromFile (OCI_Lob *lob, OCI_File *file, big_uint offset_dst, big_uint offset_src, big_uint count)
 Copy a portion of a source FILE into a destination LOB.
 
OCI_SYM_PUBLIC boolean OCI_API OCI_LobOpen (OCI_Lob *lob, unsigned int mode)
 Open explicitly a LOB.
 
OCI_SYM_PUBLIC boolean OCI_API OCI_LobClose (OCI_Lob *lob)
 Close explicitly a LOB.
 
OCI_SYM_PUBLIC boolean OCI_API OCI_LobIsEqual (OCI_Lob *lob, OCI_Lob *lob2)
 Compare two LOB handles for equality.
 
OCI_SYM_PUBLIC boolean OCI_API OCI_LobAssign (OCI_Lob *lob, OCI_Lob *lob_src)
 Assign a LOB to another one.
 
OCI_SYM_PUBLIC big_uint OCI_API OCI_LobGetMaxSize (OCI_Lob *lob)
 Return the maximum size that the LOB can contain.
 
OCI_SYM_PUBLIC boolean OCI_API OCI_LobFlush (OCI_Lob *lob)
 Flush LOB content to the server.
 
OCI_SYM_PUBLIC boolean OCI_API OCI_LobEnableBuffering (OCI_Lob *lob, boolean value)
 Enable/disable buffering mode on the given LOB handle.
 
OCI_SYM_PUBLIC OCI_Connection *OCI_API OCI_LobGetConnection (OCI_Lob *lob)
 Retrieve the connection handle from the LOB handle.
 
OCI_SYM_PUBLIC boolean OCI_API OCI_LobIsRemote (OCI_Lob *lob)
 Indicate if the given LOB belongs to a local or remote database table.
 

Function Documentation

◆ OCI_LobCreate()

OCI_SYM_PUBLIC OCI_Lob *OCI_API OCI_LobCreate ( OCI_Connection con,
unsigned int  type 
)

#include <api.h>

Create a local temporary Lob instance.

Parameters
con- Connection handle
type- Lob type

Supported LOB types:

  • OCI_BLOB : Binary LOB.
  • OCI_CLOB : Character LOB.
  • OCI_NCLOB : National Character LOB.
Returns
The LOB handle on success, or NULL on failure.

Referenced by ocilib::Lob< T, U >::Lob().

◆ OCI_LobFree()

OCI_SYM_PUBLIC boolean OCI_API OCI_LobFree ( OCI_Lob lob)

#include <api.h>

Free a local temporary lob.

Parameters
lob- Lob handle
Warning
Only LOBs created with OCI_LobCreate() should be freed by OCI_LobFree().
Returns
TRUE on success, otherwise FALSE.

◆ OCI_LobArrayCreate()

OCI_SYM_PUBLIC OCI_Lob **OCI_API OCI_LobArrayCreate ( OCI_Connection con,
unsigned int  type,
unsigned int  nbelem 
)

#include <api.h>

Create an array of LOB objects.

Parameters
con- Connection handle
type- LOB type
nbelem- Number of elements in the array
Note
See OCI_LobCreate() for more details.
Returns
The LOB handle array on success, or NULL on failure.

◆ OCI_LobArrayFree()

OCI_SYM_PUBLIC boolean OCI_API OCI_LobArrayFree ( OCI_Lob **  lobs)

#include <api.h>

Free an array of LOB objects.

Parameters
lobs- Array of LOB objects
Warning
Only arrays of LOBs created with OCI_LobArrayCreate() should be freed by OCI_LobArrayFree().
Returns
TRUE on success, otherwise FALSE.

◆ OCI_LobGetType()

OCI_SYM_PUBLIC unsigned int OCI_API OCI_LobGetType ( OCI_Lob lob)

#include <api.h>

Return the type of the given Lob object.

Parameters
lob- Lob handle
Note
For possible values, see OCI_LobCreate().
Returns
The LOB type, or OCI_UNKNOWN if the input handle is NULL.

Referenced by ocilib::Lob< T, U >::GetType().

◆ OCI_LobSeek()

OCI_SYM_PUBLIC boolean OCI_API OCI_LobSeek ( OCI_Lob lob,
big_uint  offset,
unsigned int  mode 
)

#include <api.h>

Perform a seek operation on the OCI_lob content buffer.

Parameters
lob- Lob handle
offset- Offset from current position (bytes or characters)
mode- Seek mode

Parameter 'mode' can be one of the following values:

  • OCI_SEEK_SET : Set the LOB current offset to the given absolute offset.
  • OCI_SEEK_END : Set the LOB current offset to the end of the LOB.
  • OCI_SEEK_CUR : Move the LOB current offset by the number of bytes or characters given by parameter 'offset'.
Note
  • For CLOBs and NCLOBs, offset is in characters.
  • For BLOBs and BFILEs, offset is in bytes.
Position in the LOB buffer starts at 0.
Returns
TRUE on success, otherwise FALSE.

Referenced by ocilib::Lob< T, U >::Seek().

◆ OCI_LobGetOffset()

OCI_SYM_PUBLIC big_uint OCI_API OCI_LobGetOffset ( OCI_Lob lob)

#include <api.h>

Return the current position in the Lob content buffer.

Parameters
lob- Lob handle
Returns
The LOB position (starting with 0), or 0 on failure.

Referenced by ocilib::Lob< T, U >::GetOffset().

◆ OCI_LobRead()

OCI_SYM_PUBLIC unsigned int OCI_API OCI_LobRead ( OCI_Lob lob,
void *  buffer,
unsigned int  len 
)

#include <api.h>

[OBSOLETE] Read a portion of a lob into the given buffer

Parameters
lob- Lob handle
buffer- Pointer to a buffer
len- Length of the buffer (in bytes or characters)
Note
Length is expressed in:
  • Bytes for BLOBs.
  • Characters for CLOBs/NCLOBs.
Warning
This call is obsolete. Use OCI_LobRead2() instead.
Returns
The number of bytes/characters read on success, or 0 on failure.

◆ OCI_LobRead2()

OCI_SYM_PUBLIC boolean OCI_API OCI_LobRead2 ( OCI_Lob lob,
void *  buffer,
unsigned int *  char_count,
unsigned int *  byte_count 
)

#include <api.h>

Read a portion of a lob into the given buffer.

Parameters
lob- Lob handle
buffer- Pointer to a buffer
char_count- [in/out] Pointer to maximum number of characters
byte_count- [in/out] Pointer to maximum number of bytes
Note
On input, 'char_count' and 'byte_count' are values to read into the buffer. On output, 'char_count' and 'byte_count' are values read into the buffer.
For BLOBs, only the parameter 'byte_count' is used. For CLOBs, both parameters can be used: On input:
  • If 'byte_count' is set to zero, it is computed from 'char_count'.
  • If 'char_count' is set to zero, it is computed from 'byte_count'.
Returns
TRUE on success, otherwise FALSE.

◆ OCI_LobWrite()

OCI_SYM_PUBLIC unsigned int OCI_API OCI_LobWrite ( OCI_Lob lob,
void *  buffer,
unsigned int  len 
)

#include <api.h>

[OBSOLETE] Write a buffer into a LOB

Parameters
lob- Lob handle
buffer- Pointer to a buffer
len- Length of the buffer (in bytes or characters)
Note
Length is expressed in:
  • Bytes for BLOBs.
  • Characters for CLOBs/NCLOBs.
Warning
This call is obsolete. Use OCI_LobWrite2() instead.
Returns
The number of bytes/characters written on success, or 0 on failure.

◆ OCI_LobWrite2()

OCI_SYM_PUBLIC boolean OCI_API OCI_LobWrite2 ( OCI_Lob lob,
void *  buffer,
unsigned int *  char_count,
unsigned int *  byte_count 
)

#include <api.h>

Write a buffer into a LOB.

Parameters
lob- Lob handle
buffer- Pointer to a buffer
char_count- [in/out] Pointer to maximum number of characters
byte_count- [in/out] Pointer to maximum number of bytes
Note
On input, 'char_count' and 'byte_count' are values to write from the buffer. On output, 'char_count' and 'byte_count' are values written from the buffer.
For BLOBs, only the parameter 'byte_count' is used. For CLOBs, both parameters can be used: On input:
  • If 'byte_count' is set to zero, it is computed from 'char_count'.
  • If 'char_count' is set to zero, it is computed from 'byte_count'.
Returns
TRUE on success, otherwise FALSE.

Referenced by ocilib::Lob< T, U >::Write().

◆ OCI_LobTruncate()

OCI_SYM_PUBLIC boolean OCI_API OCI_LobTruncate ( OCI_Lob lob,
big_uint  size 
)

#include <api.h>

Truncate the given LOB to a shorter length.

Parameters
lob- Lob handle
size- New length (in bytes or characters)
Note
Length is expressed in:
  • Bytes for BLOBs.
  • Characters for CLOBs/NCLOBs.
If the current offset was beyond the new size, it is updated to an EOF position so that further write calls append data.
Returns
TRUE on success, otherwise FALSE.

Referenced by ocilib::Lob< T, U >::Truncate().

◆ OCI_LobGetLength()

OCI_SYM_PUBLIC big_uint OCI_API OCI_LobGetLength ( OCI_Lob lob)

#include <api.h>

Return the actual length of a LOB.

Parameters
lob- Lob handle
Note
The returned value is in bytes for BLOBs and characters for CLOBs/NCLOBs.
Returns
The LOB length, or 0 on failure.

Referenced by ocilib::Lob< T, U >::GetLength().

◆ OCI_LobGetChunkSize()

OCI_SYM_PUBLIC unsigned int OCI_API OCI_LobGetChunkSize ( OCI_Lob lob)

#include <api.h>

Return the chunk size of a LOB.

Parameters
lob- Lob handle
Note
This chunk size corresponds to the chunk size used by the LOB data layer when accessing and modifying the LOB value. According to Oracle documentation, performance will be improved if the application issues read or write requests using a multiple of this chunk size.
The returned value is in bytes for BLOBs and characters for CLOBs/NCLOBs.
Returns
The chunk size, or 0 on failure.

Referenced by ocilib::Lob< T, U >::GetChunkSize().

◆ OCI_LobErase()

OCI_SYM_PUBLIC big_uint OCI_API OCI_LobErase ( OCI_Lob lob,
big_uint  offset,
big_uint  len 
)

#include <api.h>

Erase a portion of the LOB at a given position.

Parameters
lob- Lob handle
offset- Absolute position in source LOB
len- Number of bytes or characters to erase
Note
Absolute position starts at 0. Erasing means "overwriting" the range of values at the given offset with:
  • Spaces for CLOBs/NCLOBs.
  • Zero bytes for BLOBs.
Returns
The number of bytes (BLOB) or characters (CLOB/NCLOB) erased on success, or 0 on failure.

Referenced by ocilib::Lob< T, U >::Erase().

◆ OCI_LobAppend()

OCI_SYM_PUBLIC unsigned int OCI_API OCI_LobAppend ( OCI_Lob lob,
void *  buffer,
unsigned int  len 
)

#include <api.h>

Append a buffer at the end of a LOB.

Parameters
lob- Lob handle
buffer- Pointer to a buffer
len- Length of the buffer (in bytes or characters)
Note
Length is expressed in:
  • Bytes for BLOBs.
  • Characters for CLOBs.
Returns
The number of bytes/characters written on success, or 0 on failure.

Referenced by ocilib::Lob< T, U >::Append().

◆ OCI_LobAppend2()

OCI_SYM_PUBLIC boolean OCI_API OCI_LobAppend2 ( OCI_Lob lob,
void *  buffer,
unsigned int *  char_count,
unsigned int *  byte_count 
)

#include <api.h>

Append a buffer at the end of a LOB.

Parameters
lob- Lob handle
buffer- Pointer to a buffer
char_count- [in/out] Pointer to maximum number of characters
byte_count- [in/out] Pointer to maximum number of bytes
Note
On input, 'char_count' and 'byte_count' are values to write from the buffer. On output, 'char_count' and 'byte_count' are values written from the buffer.
For BLOBs, only the parameter 'byte_count' is used. For CLOBs, both parameters can be used: On input:
  • If 'byte_count' is set to zero, it is computed from 'char_count'.
  • If 'char_count' is set to zero, it is computed from 'byte_count'.
Returns
TRUE on success, otherwise FALSE.

◆ OCI_LobAppendLob()

OCI_SYM_PUBLIC boolean OCI_API OCI_LobAppendLob ( OCI_Lob lob,
OCI_Lob lob_src 
)

#include <api.h>

Append a source LOB at the end of a destination LOB.

Parameters
lob- Destination Lob handle
lob_src- Source Lob handle
Returns
TRUE on success, otherwise FALSE.

Referenced by ocilib::Lob< T, U >::Append().

◆ OCI_LobIsTemporary()

OCI_SYM_PUBLIC boolean OCI_API OCI_LobIsTemporary ( OCI_Lob lob)

#include <api.h>

Check if the given LOB is a temporary LOB.

Parameters
lob- Lob handle
Returns
TRUE if it is a temporary LOB, otherwise FALSE.

Referenced by ocilib::Lob< T, U >::IsTemporary().

◆ OCI_LobCopy()

OCI_SYM_PUBLIC boolean OCI_API OCI_LobCopy ( OCI_Lob lob,
OCI_Lob lob_src,
big_uint  offset_dst,
big_uint  offset_src,
big_uint  count 
)

#include <api.h>

Copy a portion of a source LOB into a destination LOB.

Parameters
lob- Destination Lob handle
lob_src- Source Lob handle
offset_dst- Absolute position in destination LOB
offset_src- Absolute position in source LOB
count- Number of bytes or characters to copy
Note
For character LOBs (CLOBs/NCLOBs), the parameters count, offset_dst and offset_src are expressed in characters and not in bytes.
Absolute position starts at 0.
Returns
TRUE on success, otherwise FALSE.

Referenced by ocilib::Lob< T, U >::Copy().

◆ OCI_LobCopyFromFile()

OCI_SYM_PUBLIC boolean OCI_API OCI_LobCopyFromFile ( OCI_Lob lob,
OCI_File file,
big_uint  offset_dst,
big_uint  offset_src,
big_uint  count 
)

#include <api.h>

Copy a portion of a source FILE into a destination LOB.

Parameters
lob- Destination Lob handle
file- Source File handle
offset_dst- Absolute position in destination LOB
offset_src- Absolute position in source file
count- Number of bytes to copy
Note
  • For character LOBs (CLOBs/NCLOBs), the parameter offset_dst is expressed in characters and not in bytes.
  • offset_src is always in bytes.
Absolute position starts at 0.
Returns
TRUE on success, otherwise FALSE.

◆ OCI_LobOpen()

OCI_SYM_PUBLIC boolean OCI_API OCI_LobOpen ( OCI_Lob lob,
unsigned int  mode 
)

#include <api.h>

Open explicitly a LOB.

Parameters
lob- Lob handle
mode- Open mode

Possible values for mode are:

  • OCI_LOB_READONLY : Read-only access.
  • OCI_LOB_READWRITE : Read/write access.
Note
  • A call to OCI_LobOpen() is not necessary to manipulate a LOB.
  • If a LOB has not been opened explicitly, triggers are fired and indexes updated at every read/write/append operation.
Returns
TRUE on success, otherwise FALSE.

Referenced by ocilib::Lob< T, U >::Open().

◆ OCI_LobClose()

OCI_SYM_PUBLIC boolean OCI_API OCI_LobClose ( OCI_Lob lob)

#include <api.h>

Close explicitly a LOB.

Parameters
lob- Lob handle
Note
Returns
TRUE on success, otherwise FALSE.

Referenced by ocilib::Lob< T, U >::Close().

◆ OCI_LobIsEqual()

OCI_SYM_PUBLIC boolean OCI_API OCI_LobIsEqual ( OCI_Lob lob,
OCI_Lob lob2 
)

#include <api.h>

Compare two LOB handles for equality.

Parameters
lob- Lob handle
lob2- Lob handle to compare
Returns
TRUE if the LOBs are not null and equal, otherwise FALSE.

◆ OCI_LobAssign()

OCI_SYM_PUBLIC boolean OCI_API OCI_LobAssign ( OCI_Lob lob,
OCI_Lob lob_src 
)

#include <api.h>

Assign a LOB to another one.

Parameters
lob- Destination Lob handle
lob_src- Source Lob handle
Returns
TRUE on success, otherwise FALSE.

Referenced by ocilib::Lob< T, U >::Clone().

◆ OCI_LobGetMaxSize()

OCI_SYM_PUBLIC big_uint OCI_API OCI_LobGetMaxSize ( OCI_Lob lob)

#include <api.h>

Return the maximum size that the LOB can contain.

Parameters
lob- Lob handle
Returns
The maximum LOB size, or 0 on failure.

Referenced by ocilib::Lob< T, U >::GetMaxSize().

◆ OCI_LobFlush()

OCI_SYM_PUBLIC boolean OCI_API OCI_LobFlush ( OCI_Lob lob)

#include <api.h>

Flush LOB content to the server.

Parameters
lob- Lob handle
Returns
TRUE on success, otherwise FALSE.

Referenced by ocilib::Lob< T, U >::Flush().

◆ OCI_LobEnableBuffering()

OCI_SYM_PUBLIC boolean OCI_API OCI_LobEnableBuffering ( OCI_Lob lob,
boolean  value 
)

#include <api.h>

Enable/disable buffering mode on the given LOB handle.

Parameters
lob- Lob handle
value- Enable/disable buffering mode
Note
Oracle "LOB Buffering Subsystem" allows client applications to speed up read/write of small buffers on LOB objects. Check Oracle documentation for more details on "LOB Buffering Subsystem". This reduces the number of network round trips and LOB versions, thereby improving LOB performance significantly.
Warning
According to Oracle documentation, the following operations are not permitted on LOBs when buffering is on: OCI_LobCopy(), OCI_LobAppend(), OCI_LobErase(), OCI_LobGetLength(), OCI_LobTruncate().
Returns
TRUE on success, otherwise FALSE.

Referenced by ocilib::Lob< T, U >::EnableBuffering().

◆ OCI_LobGetConnection()

OCI_SYM_PUBLIC OCI_Connection *OCI_API OCI_LobGetConnection ( OCI_Lob lob)

#include <api.h>

Retrieve the connection handle from the LOB handle.

Parameters
lob- Lob handle
Returns
The connection handle, or NULL on failure.

Referenced by ocilib::Lob< T, U >::GetConnection().

◆ OCI_LobIsRemote()

OCI_SYM_PUBLIC boolean OCI_API OCI_LobIsRemote ( OCI_Lob lob)

#include <api.h>

Indicate if the given LOB belongs to a local or remote database table.

Parameters
lob- Lob handle
Warning
Requires Oracle 12cR2 (both client and server side), otherwise it returns FALSE.
Returns
TRUE if the LOB is remote, otherwise FALSE.

Referenced by ocilib::Lob< T, U >::IsRemote().