Skip Headers
Oracle® Call Interface Programmer's Guide,
10g Release 2 (10.2)

Part Number B14250-02
Go to Documentation Home
Home
Go to Book List
Book List
Go to Table of Contents
Contents
Go to Index
Index
Go to Master Index
Master Index
Go to Feedback page
Contact Us

Go to previous page
Previous
Go to next page
Next
PDF · Mobi · ePub

OCI Raw Functions

This section describes the OCI Raw functions.

Table 18-15 Raw Functions

Function/Page Purpose

OCIRawAllocSize()

Get allocated size of raw memory in bytes

OCIRawAssignBytes()

Assign raw bytes to raw

OCIRawAssignRaw()

Assign raw to raw

OCIRawPtr()

Get raw data Pointer

OCIRawResize()

Resize memory of variable-length raw

OCIRawSize()

Get raw size



OCIRawAllocSize()

Purpose

Gets allocated size of raw memory in bytes.

Syntax

sword OCIRawAllocSize ( OCIEnv             *env,
                        OCIError           *err,
                        CONST OCIRaw       *raw,
                        ub4                *allocsize );

Parameters

env (IN/OUT)

The OCI environment handle initialized in object mode.

err (IN/OUT)

The OCI error handle. If there is an error, it is recorded in err and this function returns OCI_ERROR. Obtain diagnostic information by calling OCIErrorGet().

raw (IN)

Raw data whose allocated size in bytes is returned. This must be a non-NULL pointer.

allocsize (OUT)

The allocated size of raw memory in bytes is returned.

Comments

The allocated size is greater than or equal to the actual raw size.

Related Functions

OCIErrorGet(), OCIRawResize(), OCIRawSize()


OCIRawAssignBytes()

Purpose

Assigns raw bytes of type ub1* to Oracle OCIRaw* datatype.

Syntax

sword OCIRawAssignBytes ( OCIEnv             *env,
                          OCIError           *err, 
                          CONST ub1          *rhs,
                          ub4                rhs_len,
                          OCIRaw             **lhs );

Parameters

env (IN/OUT)

The OCI environment handle initialized in object mode.

err (IN/OUT)

The OCI error handle. If there is an error, it is recorded in err and this function returns OCI_ERROR. Obtain diagnostic information by calling OCIErrorGet().

rhs (IN)

Right-hand side (source) of the assignment, of datatype ub1.

rhs_len (IN)

Length of the rhs raw bytes.

lhs (IN/OUT)

Left-hand side (target) of the assignment OCIRaw data.

Comments

Assigns rhs raw bytes to lhs raw datatype. The lhs raw may be resized depending upon the size of the rhs. The raw bytes assigned are of type ub1.

Related Functions

OCIErrorGet(), OCIRawAssignRaw()


OCIRawAssignRaw()

Purpose

Assign one Oracle raw datatype to another Oracle raw datatype.

Syntax

sword OCIRawAssignRaw ( OCIEnv             *env,
                        OCIError           *err, 
                        CONST OCIRaw       *rhs, 
                        OCIRaw             **lhs );

Parameters

env (IN/OUT)

The OCI environment handle initialized in object mode.

err (IN/OUT)

The OCI error handle. If there is an error, it is recorded in err and this function returns OCI_ERROR. Obtain diagnostic information by calling OCIErrorGet().

rhs (IN)

Right-hand side (source) of the assignment; OCIRaw data.

lhs (IN/OUT)

Left-hand side (target) of the assignment; OCIRaw data.

Comments

Assigns rhs raw to lhs raw. The lhs raw may be resized depending upon the size of the rhs.

Related Functions

OCIErrorGet(), OCIRawAssignBytes()


OCIRawPtr()

Purpose

Gets the pointer to raw data.

Syntax

ub1 *OCIRawPtr ( OCIEnv             *env,
                 CONST OCIRaw       *raw );

Parameters

env (IN/OUT)

The OCI environment handle initialized in object mode.

raw (IN)

Pointer to the data of a given raw is returned.

Comments

None.

Related Functions

OCIErrorGet(), OCIRawAssignRaw()


OCIRawResize()

Purpose

Resizes the memory of a given variable-length raw.

Syntax

sword OCIRawResize ( OCIEnv          *env, 
                     OCIError        *err,
                     ub2             new_size, 
                     OCIRaw          **raw );

Parameters

env (IN/OUT)

The OCI environment handle initialized in object mode.

err (IN/OUT)

The OCI error handle. If there is an error, it is recorded in err and this function returns OCI_ERROR. Obtain diagnostic information by calling OCIErrorGet().

new_size (IN)

New size of the raw data in bytes.

raw (IN)

Variable-length raw pointer; the raw is resized to new_size.

Comments

This function resizes the memory of the given variable-length raw in the object cache. The previous contents of the raw are not preserved. This function may allocate the raw in a new memory region in which case the original memory occupied by the given raw will be freed. If the input raw is NULL (raw == NULL), then this function will allocate memory for the raw data.

If the new_size is 0, then this function frees the memory occupied by raw and a NULL pointer value is returned.

Related Functions

OCIErrorGet(), OCIRawAllocSize(), OCIRawSize()


OCIRawSize()

Purpose

Returns the size of a given raw in bytes.

Syntax

ub4 OCIRawSize ( OCIEnv             *env,
                 CONST OCIRaw       *raw );

Parameters

env (IN/OUT)

The OCI environment handle initialized in object mode.

raw (IN/OUT)

Raw whose size is returned.

Comments

None.

Related Functions

OCIErrorGet(), OCIRawAllocSize(), OCIRawSize()