OCILIB (C Driver for Oracle) 3.9.2
Functions
Statements control

Detailed Description

Those functions give extra information about OCILIB statements and can modify their behaviour.

Functions

OCI_EXPORT unsigned int OCI_API OCI_GetStatementType (OCI_Statement *stmt)
 Return the type of a SQL statement.
OCI_EXPORT boolean OCI_API OCI_SetFetchMode (OCI_Statement *stmt, unsigned int mode)
 Set the fetch mode of a SQL statement.
OCI_EXPORT unsigned int OCI_API OCI_GetFetchMode (OCI_Statement *stmt)
 Return the fetch mode of a SQL statement.
OCI_EXPORT boolean OCI_API OCI_SetBindMode (OCI_Statement *stmt, unsigned int mode)
 Set the binding mode of a SQL statement.
OCI_EXPORT unsigned int OCI_API OCI_GetBindMode (OCI_Statement *stmt)
 Return the binding mode of a SQL statement.
OCI_EXPORT boolean OCI_API OCI_SetBindAllocation (OCI_Statement *stmt, unsigned int mode)
 Set the bind allocation mode of a SQL statement.
OCI_EXPORT unsigned int OCI_API OCI_GetBindAllocation (OCI_Statement *stmt)
 Return the bind allocation mode of a SQL statement.
OCI_EXPORT boolean OCI_API OCI_SetFetchSize (OCI_Statement *stmt, unsigned int size)
 Set the number of rows fetched per internal server fetch call.
OCI_EXPORT unsigned int OCI_API OCI_GetFetchSize (OCI_Statement *stmt)
 Return the number of rows fetched per internal server fetch call.
OCI_EXPORT boolean OCI_API OCI_SetPrefetchSize (OCI_Statement *stmt, unsigned int size)
 Set the number of rows pre-fetched by OCI Client.
OCI_EXPORT unsigned int OCI_API OCI_GetPrefetchSize (OCI_Statement *stmt)
 Return the number of rows pre-fetched by OCI Client.
OCI_EXPORT boolean OCI_API OCI_SetPrefetchMemory (OCI_Statement *stmt, unsigned int size)
 Set the number of rows pre-fetched by OCI Client.
OCI_EXPORT unsigned int OCI_API OCI_GetPrefetchMemory (OCI_Statement *stmt)
 Return the amount of memory used to retrieve rows pre-fetched by OCI Client.
OCI_EXPORT boolean OCI_API OCI_SetLongMaxSize (OCI_Statement *stmt, unsigned int size)
 Set the LONG datatype piece buffer size.
OCI_EXPORT unsigned int OCI_API OCI_GetLongMaxSize (OCI_Statement *stmt)
 Return the LONG datatype piece buffer size.
OCI_EXPORT boolean OCI_API OCI_SetLongMode (OCI_Statement *stmt, unsigned int mode)
 Set the long datatype handling mode of a SQL statement.
OCI_EXPORT unsigned int OCI_API OCI_GetLongMode (OCI_Statement *stmt)
 Return the long datatype handling mode of a SQL statement.
OCI_EXPORT OCI_Connection *OCI_API OCI_StatementGetConnection (OCI_Statement *stmt)
 Return the connection handle associated with a statement handle.

Function Documentation

OCI_EXPORT unsigned int OCI_API OCI_GetStatementType ( OCI_Statement stmt)

Return the type of a SQL statement.

Parameters:
stmt- Statement handle
Note:
Possible values are :
  • OCI_CST_SELECT : select statement
  • OCI_CST_UPDATE : update statement
  • OCI_CST_DELETE : delete statement
  • OCI_CST_INSERT : insert statement
  • OCI_CST_CREATE : create statement
  • OCI_CST_DROP : drop statement
  • OCI_CST_ALTER : alter statement
  • OCI_CST_BEGIN : begin (pl/sql) statement
  • OCI_CST_DECLARE : declare (pl/sql) statement
Returns:
The statement type on success or OCI_UNKOWN on error

Definition at line 3785 of file statement.c.

Referenced by OCI_Immediate(), and OCI_ImmediateFmt().

OCI_EXPORT boolean OCI_API OCI_SetFetchMode ( OCI_Statement stmt,
unsigned int  mode 
)

Set the fetch mode of a SQL statement.

Parameters:
stmt- Statement handle
mode- fetch mode value
Warning:
OCI_SetFetchMode() MUST be called before anyOCI_ExecuteXXX() call
Note:
Possible values are :
  • OCI_SFM_DEFAULT
  • OCI_SFM_SCROLLABLE

Definition at line 3801 of file statement.c.

OCI_EXPORT unsigned int OCI_API OCI_GetFetchMode ( OCI_Statement stmt)

Return the fetch mode of a SQL statement.

Parameters:
stmt- Statement handle
Note:
See OCI_SetFetchMode() for possible values Default value is OCI_FETCH_FORWARD_ONLY

Definition at line 3822 of file statement.c.

OCI_EXPORT boolean OCI_API OCI_SetBindMode ( OCI_Statement stmt,
unsigned int  mode 
)

Set the binding mode of a SQL statement.

Parameters:
stmt- Statement handle
mode- binding mode value
Note:
Possible values are :
  • OCI_BIND_BY_POS : position binding
  • OCI_BIND_BY_NAME : name binding

Definition at line 3840 of file statement.c.

OCI_EXPORT unsigned int OCI_API OCI_GetBindMode ( OCI_Statement stmt)

Return the binding mode of a SQL statement.

Parameters:
stmt- Statement handle
Note:
See OCI_SetBindMode() for possible values Default value is OCI_BIND_BY_NAME
if stmt is NULL, the return value is OCI_UNKNOWN

Definition at line 3859 of file statement.c.

OCI_EXPORT boolean OCI_API OCI_SetBindAllocation ( OCI_Statement stmt,
unsigned int  mode 
)

Set the bind allocation mode of a SQL statement.

Parameters:
stmt- Statement handle
mode- bind allocation mode value
Note:
Possible values are :
  • OCI_BAM_EXTERNAL : bind variable are allocated by user code
  • OCI_BAM_INTERNAL : bind variable are allocated internally

Definition at line 3875 of file statement.c.

OCI_EXPORT unsigned int OCI_API OCI_GetBindAllocation ( OCI_Statement stmt)

Return the bind allocation mode of a SQL statement.

Parameters:
stmt- Statement handle
Note:
See OCI_SetBindAllocation() for possible values Default value is OCI_BAM_EXTERNAL
if stmt is NULL, the return value is OCI_UNKNOWN

Definition at line 3894 of file statement.c.

OCI_EXPORT boolean OCI_API OCI_SetFetchSize ( OCI_Statement stmt,
unsigned int  size 
)

Set the number of rows fetched per internal server fetch call.

Parameters:
stmt- Statement handle
size- number of rows to fetch
Returns:
TRUE on success otherwise FALSE

Definition at line 3910 of file statement.c.

Referenced by OCI_Prepare().

OCI_EXPORT unsigned int OCI_API OCI_GetFetchSize ( OCI_Statement stmt)

Return the number of rows fetched per internal server fetch call.

Note:
Default value is set to constant OCI_FETCH_SIZE
Parameters:
stmt- Statement handle

Definition at line 3931 of file statement.c.

OCI_EXPORT boolean OCI_API OCI_SetPrefetchSize ( OCI_Statement stmt,
unsigned int  size 
)

Set the number of rows pre-fetched by OCI Client.

Parameters:
stmt- Statement handle
size- number of rows to pre-fetch
Note:
To turn off pre-fetching, set both attributes (size and memory) to 0.
Returns:
TRUE on success otherwise FALSE

Definition at line 3947 of file statement.c.

Referenced by OCI_Prepare().

OCI_EXPORT unsigned int OCI_API OCI_GetPrefetchSize ( OCI_Statement stmt)

Return the number of rows pre-fetched by OCI Client.

Note:
Default value is set to constant OCI_PREFETCH_SIZE
Parameters:
stmt- Statement handle

Definition at line 3981 of file statement.c.

OCI_EXPORT boolean OCI_API OCI_SetPrefetchMemory ( OCI_Statement stmt,
unsigned int  size 
)

Set the number of rows pre-fetched by OCI Client.

Parameters:
stmt- Statement handle
size- amount of memory to fetch
Note:
Default value is 0 and the pre-fetch size attribute is used instead. When both attributes are set (pre-fetch size and memory) and pre-fetch memory value can hold more rows than specified by pre-fetch size, OCI uses pre-fetch size instead.
OCILIB set pre-fetch attribute to OCI_PREFETCH_SIZE when a statement is created. To setup a big value for OCI_SetPrefetchMemory(), you must call OCI_SetPrefetchSize() to 0 to make OCI consider this attribute.
Returns:
TRUE on success otherwise FALSE

Definition at line 3997 of file statement.c.

OCI_EXPORT unsigned int OCI_API OCI_GetPrefetchMemory ( OCI_Statement stmt)

Return the amount of memory used to retrieve rows pre-fetched by OCI Client.

Parameters:
stmt- Statement handle
Note:
Default value is 0

Definition at line 4031 of file statement.c.

OCI_EXPORT boolean OCI_API OCI_SetLongMaxSize ( OCI_Statement stmt,
unsigned int  size 
)

Set the LONG datatype piece buffer size.

Parameters:
stmt- Statement handle
size- maximum size for long buffer
Returns:
TRUE on success otherwise FALSE

Definition at line 4047 of file statement.c.

OCI_EXPORT unsigned int OCI_API OCI_GetLongMaxSize ( OCI_Statement stmt)

Return the LONG datatype piece buffer size.

Note:
Default value is set to constant OCI_SIZE_LONG
Parameters:
stmt- Statement handle

Definition at line 4068 of file statement.c.

OCI_EXPORT boolean OCI_API OCI_SetLongMode ( OCI_Statement stmt,
unsigned int  mode 
)

Set the long datatype handling mode of a SQL statement.

Parameters:
stmt- Statement handle
mode- binding mode value
Note:
Possible values are :
  • OCI_LONG_EXPLICIT : LONGs are explicitly handled by OCI_Long type
  • OCI_LONG_IMPLICIT : LONGs are implicitly mapped to string type in the limits of VARCHAR2 size capacity

LONG RAWs can't be handled with OCI_LONG_IMPLICIT

Definition at line 4084 of file statement.c.

OCI_EXPORT unsigned int OCI_API OCI_GetLongMode ( OCI_Statement stmt)

Return the long datatype handling mode of a SQL statement.

Parameters:
stmt- Statement handle
Note:
See OCI_SetLongMode() for possible values

Definition at line 4103 of file statement.c.

OCI_EXPORT OCI_Connection* OCI_API OCI_StatementGetConnection ( OCI_Statement stmt)

Return the connection handle associated with a statement handle.

Parameters:
stmt- Statement handle

Definition at line 4119 of file statement.c.