Functions

Fetching data


Detailed Description

OCILIB offers a really easy and smart mechanism to fetch data from a SQL Statement. It looks like what's found in JDBC and other object oriented databases frameworks.

Only SELECTs statement, DML with returning clause and some PL/SQL blocks return a cursor that can be fetched by host programs. That cursor, or resultset, is encapsulated in OCILIB by the OCI_Resultset object.

So, after any successful call to an OCI_Executexxx() function that executed a fetchable statement or filled output bind variables, the resultset can be retrieved by calling OCI_GetResultset()

The creation of a OCI_Resultset object consists in :

OCILIB supports multi-row fetching for increasing performances. Instead of fetching data row by row from the server (that induces lots of roundtrips between the client and the server), the library prefetches data chunk by chunks (default is 20 rows). So, less network traffic and better performances. These mechanisms are completely hidden from the application which fetches the resultset row by row.

Once the Resultset handle is retrieved :

Scrollable Resultsets

Oracle 9i introduced scrollable cursors (resultsets in OCILIB) that can be fetched:

Scrollable statements uses more server and client resources and should only be used when necessary.

OCILIB support scrollable cursors from version OCILIB 3.0.0.

Resultsets are 'forward only' by default. Call OCI_SetFetchMode() with OCI_SFM_SCROLLABLE to enable scrollable resultsets for a given statement.

Warning:
Any use of scrollable fetching functions with a resultset that depends on a statement with fetch mode = OCI_SFM_DEFAULT will fail !
Note:
If the column internal data does not match the requested type, OCILIB tries to convert the data when it's possible and throws an error if not.

The properties (columns names, types ...) of the resultset are accessible through a set of APIs.

Implicit conversion to string types

OCI_GetString() performs an implicit conversion from the following datatypes:

The following type are not supported for implicit conversion:

OCI_GetString() performs an implicit conversion from the following datatypes:

Fetching rows into user structures

From version 3.7.0, it is possible to fetch a complete row into a user defined structure. Each column of the resultset is mapped to a structure member. The mapping rules are :

See OCI_GetStruct() and OCI_SetStructNumericType() for more details

Fetch Example
#include "ocilib.h"

int main(void)
{
    OCI_Connection *cn;
    OCI_Statement  *st;
    OCI_Resultset  *rs;

    if (!OCI_Initialize(NULL, NULL, OCI_ENV_DEFAULT))
        return EXIT_FAILURE;

    cn  = OCI_ConnectionCreate("db", "usr", "pwd", OCI_SESSION_DEFAULT);
    st  = OCI_StatementCreate(cn);

    OCI_ExecuteStmt(st, "select * from products");

    rs = OCI_GetResultset(st);
   
    while (OCI_FetchNext(rs))
        printf("code: %i, name %s\n", OCI_GetInt(rs, 1)  , OCI_GetString(rs, 2));

    printf("\n%d row(s) fetched\n", OCI_GetRowCount(rs));

    OCI_Cleanup();

    return EXIT_SUCCESS;
}
Fetch Rows into user structures Example
#include "ocilib.h"

typedef struct product_t
{
    int        code;
    char      *name;
    double     price;
    OCI_Date  *creation;
} product_t;

typedef struct product_ind_t
{
    boolean    code;
    boolean    name;
    boolean    price;
    boolean    creation;
} product_ind_t;


int main(void)
{
    OCI_Connection *cn;
    OCI_Statement  *st;
    OCI_Resultset  *rs;

    product_t     prd;
    product_ind_t ind;
 
    char buf[100];

    int i = 0;

    if (!OCI_Initialize(NULL, NULL, OCI_ENV_DEFAULT))
        return EXIT_FAILURE;

    cn  = OCI_ConnectionCreate("db", "usr", "pwd", OCI_SESSION_DEFAULT);
    st  = OCI_StatementCreate(cn);  

    OCI_ExecuteStmt(st, "select * from products");

    rs = OCI_GetResultset(st);

    OCI_SetStructNumericType(rs, 1,  OCI_NUM_INT);
    OCI_SetStructNumericType(rs, 3,  OCI_NUM_DOUBLE);
   
    while (OCI_FetchNext(rs))
    {
        i++;

        OCI_GetStruct(rs, &prd, &ind);

        OCI_DateToText(prd.creation, "DD-MM-YYYY", 100, buf); 
        
        printf("row #%d              \n"
               "...prd.code     : %d \n"
               "...prd.name     : %s \n"
               "...prd.price    : %g \n"
               "...prd.creation : %s \n"
               "                     \n",
               i, prd.code, prd.name, prd.price, buf
              );
    }

    printf("\n\n%d row(s) fetched\n", OCI_GetRowCount(rs));

    OCI_Cleanup();

    return EXIT_SUCCESS;
}
Metadata Example
#include "ocilib.h"

int main(void)
{
    OCI_Connection *cn;
    OCI_Statement *st;
    OCI_Resultset *rs;

    int i, n;

    if (!OCI_Initialize(NULL, NULL, OCI_ENV_DEFAULT))
        return EXIT_FAILURE;

    cn = OCI_ConnectionCreate("db", "usr", "pwd", OCI_SESSION_DEFAULT);
    st = OCI_StatementCreate(cn);
 
    OCI_ExecuteStmt(st, "select * from test_fetch");

    rs = OCI_GetResultset(st);
    n  = OCI_GetColumnCount(rs);
    
    for(i = 1; i <= n; i++)
    {
        OCI_Column *col = OCI_GetColumn(rs, i);

        printf("Field #%i : name '%s' - size %i\n", i,
                OCI_ColumnGetName(col),
                OCI_ColumnGetSize(col));
    }

    OCI_Cleanup();
 
    return EXIT_SUCCESS;
}
Ref cursor Example
#include "ocilib.h"

int main(void)
{
    OCI_Connection *cn;
    OCI_Statement  *st;
    OCI_Resultset  *rs;

    if (!OCI_Initialize(NULL, NULL, OCI_ENV_DEFAULT))
        return EXIT_FAILURE;

    cn = OCI_ConnectionCreate("db", "usr", "pwd", OCI_SESSION_DEFAULT);
 
    st = OCI_StatementCreate(cn);

    OCI_ExecuteStmt(st, "select article, cursor(select sysdate from dual) from test_fetch");
    
    rs = OCI_GetResultset(st);

    while (OCI_FetchNext(rs))
    {
        OCI_Statement *st2 = OCI_GetStatement(rs, 2);
        OCI_Resultset *rs2 = OCI_GetResultset(st2);

        while (OCI_FetchNext(rs2))
        {
            printf("article : %s, sysdate : %s\n",     
                   OCI_GetString(rs, 1),
                   OCI_GetString(rs2, 1));
        }
    }    

 
    return EXIT_SUCCESS;
}
Scrollable resultset Example
#include "ocilib.h"

int main(void)
{
    OCI_Connection *cn;
    OCI_Statement *st;
    OCI_Resultset *rs;

    if (!OCI_Initialize(NULL, NULL, OCI_ENV_DEFAULT))
       return EXIT_FAILURE;

    cn = OCI_ConnectionCreate("db", "usr", "pwd", OCI_SESSION_DEFAULT);

    st = OCI_StatementCreate(cn);

    OCI_SetFetchMode(st, OCI_SFM_SCROLLABLE);

    OCI_ExecuteStmt(st, "select int_col1, str_col from my_table");
   
    rs = OCI_GetResultset(st);
  
    /* get resultset row count */
    OCI_FetchLast(rs);
    printf("resultset contains %i rows\n", OCI_GetRowCount(rs));

    /* go to row 1 */
    OCI_FetchFirst(rs);
    printf("%i - %s\n", OCI_GetInt(rs, 1), OCI_GetString(rs, 2));

    /* enumerate from row 2 to row X */
    while (OCI_FetchNext(rs))
        printf("%i - %s\n", OCI_GetInt(rs, 1), OCI_GetString(rs, 2));

    /* enumerate from row X back to row 1 */
    while (OCI_FetchPrev(rs))
        printf("%i - %s\n", OCI_GetInt(rs, 1), OCI_GetString(rs, 2));

    /* print the 30th row */
    OCI_FetchSeek(rs, OCI_SFD_ABSOLUTE,  30);
    printf("%i - %s\n", OCI_GetCurrentRow(rs), OCI_GetInt(rs, 1), OCI_GetString(rs, 2));

    /* fetch next 30 rows */
    while ((OCI_GetCurrentRow(rs) < 60) && OCI_FetchNext(rs))
        printf("%0i - %s\n", OCI_GetInt(rs, 1), OCI_GetString(rs, 2));

    /* move back to the 45th row */
    OCI_FetchSeek(rs, OCI_SFD_RELATIVE,  -15);
    printf("%i - %s\n", OCI_GetInt(rs, 1), OCI_GetString(rs, 2));

   OCI_Cleanup();

   return EXIT_SUCCESS;
}

Functions

OCI_EXPORT OCI_Resultset *OCI_API OCI_GetResultset (OCI_Statement *stmt)
 Retrieve the resultset handle from an executed statement.
OCI_EXPORT boolean OCI_API OCI_ReleaseResultsets (OCI_Statement *stmt)
 Free the statement resultsets.
OCI_EXPORT boolean OCI_API OCI_FetchNext (OCI_Resultset *rs)
 Fetch the next row of the resultset.
OCI_EXPORT boolean OCI_API OCI_FetchPrev (OCI_Resultset *rs)
 Fetch the previous row of the resultset.
OCI_EXPORT boolean OCI_API OCI_FetchFirst (OCI_Resultset *rs)
 Fetch the first row of the resultset.
OCI_EXPORT boolean OCI_API OCI_FetchLast (OCI_Resultset *rs)
 Fetch the last row of the resultset.
OCI_EXPORT boolean OCI_API OCI_FetchSeek (OCI_Resultset *rs, unsigned int mode, int offset)
 Custom Fetch of the resultset.
OCI_EXPORT unsigned int OCI_API OCI_GetRowCount (OCI_Resultset *rs)
 Retrieve the number of rows fetched so far.
OCI_EXPORT unsigned int OCI_API OCI_GetCurrentRow (OCI_Resultset *rs)
 Retrieve the current row number.
OCI_EXPORT unsigned int OCI_API OCI_GetColumnCount (OCI_Resultset *rs)
 Return the number of columns in the resultset.
OCI_EXPORT OCI_Column *OCI_API OCI_GetColumn (OCI_Resultset *rs, unsigned int index)
 Return the column object handle at the given index in the resultset.
OCI_EXPORT OCI_Column *OCI_API OCI_GetColumn2 (OCI_Resultset *rs, const mtext *name)
 Return the column object handle from its name in the resultset.
OCI_EXPORT unsigned int OCI_API OCI_GetColumnIndex (OCI_Resultset *rs, const mtext *name)
 Return the index of the column in the result from its name.
OCI_EXPORT const mtext *OCI_API OCI_ColumnGetName (OCI_Column *col)
 Return the name of the given column.
OCI_EXPORT unsigned int OCI_API OCI_ColumnGetType (OCI_Column *col)
 Return the type of the given column.
OCI_EXPORT unsigned int OCI_API OCI_ColumnGetCharsetForm (OCI_Column *col)
 Return the charset form of the given column.
OCI_EXPORT const mtext *OCI_API OCI_ColumnGetSQLType (OCI_Column *col)
 Return the Oracle SQL type name of the column datatype.
OCI_EXPORT unsigned int OCI_API OCI_ColumnGetFullSQLType (OCI_Column *col, mtext *buffer, unsigned int len)
 Return the Oracle SQL Full name including precision and size of the column datatype.
OCI_EXPORT unsigned int OCI_API OCI_ColumnGetSize (OCI_Column *col)
 Return the size of the column.
OCI_EXPORT int OCI_API OCI_ColumnGetScale (OCI_Column *col)
 Return the scale of the column for numeric columns.
OCI_EXPORT int OCI_API OCI_ColumnGetPrecision (OCI_Column *col)
 Return the precision of the column for numeric columns.
OCI_EXPORT int OCI_API OCI_ColumnGetFractionalPrecision (OCI_Column *col)
 Return the fractional precision of the column for timestamp and interval columns.
OCI_EXPORT int OCI_API OCI_ColumnGetLeadingPrecision (OCI_Column *col)
 Return the leading precision of the column for interval columns.
OCI_EXPORT boolean OCI_API OCI_ColumnGetNullable (OCI_Column *col)
 Return the nullable attribute of the column.
OCI_EXPORT boolean OCI_API OCI_ColumnGetCharUsed (OCI_Column *col)
 Return TRUE if the length of the column is character-length or FALSE if it is byte-length.
OCI_EXPORT OCI_TypeInfo *OCI_API OCI_ColumnGetTypeInfo (OCI_Column *col)
 Return the type information object associated to the column.
OCI_EXPORT unsigned int OCI_API OCI_ColumnGetSubType (OCI_Column *col)
 Return the OCILIB object subtype of a column.
OCI_EXPORT boolean OCI_API OCI_SetStructNumericType (OCI_Resultset *rs, unsigned int index, unsigned int type)
 set the numeric datatype of the given structure member (identified from position in the resultset) to retrieve when calling OCI_GetStruct()
OCI_EXPORT boolean OCI_API OCI_SetStructNumericType2 (OCI_Resultset *rs, const mtext *name, unsigned int type)
 set the numeric datatype of the given structure member (identified from column name in the resultset) to retrieve when calling OCI_GetStruct()
OCI_EXPORT boolean OCI_API OCI_GetStruct (OCI_Resultset *rs, void *row_struct, void *row_struct_ind)
 Return the row columns values into a single structure.
OCI_EXPORT short OCI_API OCI_GetShort (OCI_Resultset *rs, unsigned int index)
 Return the current short value of the column at the given index in the resultset.
OCI_EXPORT short OCI_API OCI_GetShort2 (OCI_Resultset *rs, const mtext *name)
 Return the current short value of the column from its name in the resultset.
OCI_EXPORT unsigned short OCI_API OCI_GetUnsignedShort (OCI_Resultset *rs, unsigned int index)
 Return the current unsigned short value of the column at the given index in the resultset.
OCI_EXPORT unsigned short OCI_API OCI_GetUnsignedShort2 (OCI_Resultset *rs, const mtext *name)
 Return the current unsigned short value of the column from its name in the resultset.
OCI_EXPORT 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 resultset.
OCI_EXPORT int OCI_API OCI_GetInt2 (OCI_Resultset *rs, const mtext *name)
 Return the current integer value of the column from its name in the resultset.
OCI_EXPORT unsigned int OCI_API OCI_GetUnsignedInt (OCI_Resultset *rs, unsigned int index)
 Return the current unsigned integer value of the column at the given index in the resultset.
OCI_EXPORT unsigned int OCI_API OCI_GetUnsignedInt2 (OCI_Resultset *rs, const mtext *name)
 Return the current unsigned integer value of the column from its name in the resultset.
OCI_EXPORT big_int OCI_API OCI_GetBigInt (OCI_Resultset *rs, unsigned int index)
 Return the current big integer value of the column at the given index in the resultset.
OCI_EXPORT big_int OCI_API OCI_GetBigInt2 (OCI_Resultset *rs, const mtext *name)
 Return the current big integer value of the column from its name in the resultset.
OCI_EXPORT big_uint OCI_API OCI_GetUnsignedBigInt (OCI_Resultset *rs, unsigned int index)
 Return the current unsigned big integer value of the column at the given index in the resultset.
OCI_EXPORT big_uint OCI_API OCI_GetUnsignedBigInt2 (OCI_Resultset *rs, const mtext *name)
 Return the current unsigned big integer value of the column from its name in the resultset.
OCI_EXPORT const dtext *OCI_API OCI_GetString (OCI_Resultset *rs, unsigned int index)
 Return the current string value of the column at the given index in the resultset.
OCI_EXPORT const dtext *OCI_API OCI_GetString2 (OCI_Resultset *rs, const mtext *name)
 Return the current string value of the column from its name in the resultset.
OCI_EXPORT unsigned int OCI_API OCI_GetRaw (OCI_Resultset *rs, unsigned int index, void *buffer, unsigned int len)
 Copy the current raw value of the column at the given index into the specified buffer.
OCI_EXPORT unsigned int OCI_API OCI_GetRaw2 (OCI_Resultset *rs, const mtext *name, void *buffer, unsigned int len)
 Copy the current raw value of the column from its name into the specified buffer.
OCI_EXPORT double OCI_API OCI_GetDouble (OCI_Resultset *rs, unsigned int index)
 Return the current double value of the column at the given index in the resultset.
OCI_EXPORT double OCI_API OCI_GetDouble2 (OCI_Resultset *rs, const mtext *name)
 Return the current double value of the column from its name in the resultset.
OCI_EXPORT OCI_Date *OCI_API OCI_GetDate (OCI_Resultset *rs, unsigned int index)
 Return the current date value of the column at the given index in the resultset.
OCI_EXPORT OCI_Date *OCI_API OCI_GetDate2 (OCI_Resultset *rs, const mtext *name)
 Return the current date value of the column from its name in the resultset.
OCI_EXPORT OCI_Timestamp *OCI_API OCI_GetTimestamp (OCI_Resultset *rs, unsigned int index)
 Return the current timestamp value of the column at the given index in the resultset.
OCI_EXPORT OCI_Timestamp *OCI_API OCI_GetTimestamp2 (OCI_Resultset *rs, const mtext *name)
 Return the current timestamp value of the column from its name in the resultset.
OCI_EXPORT OCI_Interval *OCI_API OCI_GetInterval (OCI_Resultset *rs, unsigned int index)
 Return the current interval value of the column at the given index in the resultset.
OCI_EXPORT OCI_Interval *OCI_API OCI_GetInterval2 (OCI_Resultset *rs, const mtext *name)
 Return the current interval value of the column from its name in the resultset.
OCI_EXPORT OCI_Statement *OCI_API OCI_GetStatement (OCI_Resultset *rs, unsigned int index)
 Return the current cursor value (Nested table) of the column at the given index in the resultset.
OCI_EXPORT OCI_Statement *OCI_API OCI_GetStatement2 (OCI_Resultset *rs, const mtext *name)
 Return the current cursor value of the column from its name in the resultset.
OCI_EXPORT 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 resultset.
OCI_EXPORT OCI_Lob *OCI_API OCI_GetLob2 (OCI_Resultset *rs, const mtext *name)
 Return the current lob value of the column from its name in the resultset.
OCI_EXPORT OCI_File *OCI_API OCI_GetFile (OCI_Resultset *rs, unsigned int index)
 Return the current File value of the column at the given index in the resultset.
OCI_EXPORT OCI_File *OCI_API OCI_GetFile2 (OCI_Resultset *rs, const mtext *name)
 Return the current File value of the column from its name in the resultset.
OCI_EXPORT OCI_Object *OCI_API OCI_GetObject (OCI_Resultset *rs, unsigned int index)
 Return the current Object value of the column at the given index in the resultset.
OCI_EXPORT OCI_Object *OCI_API OCI_GetObject2 (OCI_Resultset *rs, const mtext *name)
 Return the current Object value of the column from its name in the resultset.
OCI_EXPORT OCI_Coll *OCI_API OCI_GetColl (OCI_Resultset *rs, unsigned int index)
 Return the current Collection value of the column at the given index in the resultset.
OCI_EXPORT OCI_Coll *OCI_API OCI_GetColl2 (OCI_Resultset *rs, const mtext *name)
 Return the current Collection value of the column from its name in the resultset.
OCI_EXPORT OCI_Ref *OCI_API OCI_GetRef (OCI_Resultset *rs, unsigned int index)
 Return the current Ref value of the column at the given index in the resultset.
OCI_EXPORT OCI_Ref *OCI_API OCI_GetRef2 (OCI_Resultset *rs, const mtext *name)
 Return the current Ref value of the column from its name in the resultset.
OCI_EXPORT OCI_Long *OCI_API OCI_GetLong (OCI_Resultset *rs, unsigned int index)
 Return the current Long value of the column at the given index in the resultset.
OCI_EXPORT OCI_Long *OCI_API OCI_GetLong2 (OCI_Resultset *rs, const mtext *name)
 Return the current Long value of the column from its name in the resultset.
OCI_EXPORT boolean OCI_API OCI_IsNull (OCI_Resultset *rs, unsigned int index)
 Check if the current row value is null for the column at the given index in the resultset.
OCI_EXPORT boolean OCI_API OCI_IsNull2 (OCI_Resultset *rs, const mtext *name)
 Check if the current row value is null for the column of the given name in the resultset.
OCI_EXPORT OCI_Statement *OCI_API OCI_ResultsetGetStatement (OCI_Resultset *rs)
 Return the statement handle associated with a resultset handle.
OCI_EXPORT unsigned int OCI_API OCI_GetDataLength (OCI_Resultset *rs, unsigned int index)
 Return the current row data length of the column at the given index in the resultset.

Function Documentation

OCI_EXPORT OCI_Resultset* OCI_API OCI_GetResultset ( OCI_Statement stmt )

Retrieve the resultset handle from an executed statement.

Parameters:
stmt- Statement handle
Note:
On a successful SELECT execution, OCI_GetResultset() always allocates a resultset wherever it contains rows.
If a DML statement includes an returning clause, a resultset is implicitly created at the SQL statement execution time
Warning:
If the statement has not been prepared and executed, no resultset will be returned
Returns:
A resultset handle on success otherwise NULL

Definition at line 733 of file resultset.c.

Referenced by OCI_SubscriptionAddStatement().

OCI_EXPORT boolean OCI_API OCI_ReleaseResultsets ( OCI_Statement stmt )

Free the statement resultsets.

Parameters:
stmt- Statement handle
Note:
This call is optional. Resultsets are automatically freed when the statement is destroyed or when it's reused.
This function has been introduced for releasing big resultsets when the application wants to keep the statement alive and doesn't know when it will be destroyed.
Returns:
TRUE on success otherwise FALSE

Definition at line 1797 of file statement.c.

OCI_EXPORT boolean OCI_API OCI_FetchNext ( OCI_Resultset rs )

Fetch the next row of the resultset.

Parameters:
rs- Resultset handle
Note:
OCI_FetchNext() works for normal and scrollable resultsets
Returns:
TRUE on success otherwise FALSE if :
  • Empty resultset
  • Last row already fetched
  • An error occurred

Definition at line 1054 of file resultset.c.

OCI_EXPORT boolean OCI_API OCI_FetchPrev ( OCI_Resultset rs )

Fetch the previous row of the resultset.

Parameters:
rs- Resultset handle
Note:
OCI_FetchPrev() works ONLY for scrollable resultsets
Returns:
TRUE on success otherwise FALSE if :
  • Empty resultset
  • First row already fetched
  • An error occurred

Definition at line 980 of file resultset.c.

OCI_EXPORT boolean OCI_API OCI_FetchFirst ( OCI_Resultset rs )

Fetch the first row of the resultset.

Parameters:
rs- Resultset handle
Note:
OCI_FetchFirst() works ONLY for scrollable resultsets
Returns:
TRUE on success otherwise FALSE if :
  • Empty resultset
  • An error occurred

Definition at line 1134 of file resultset.c.

OCI_EXPORT boolean OCI_API OCI_FetchLast ( OCI_Resultset rs )

Fetch the last row of the resultset.

Parameters:
rs- Resultset handle
Note:
OCI_FetchLast() works ONLY for scrollable resultsets
Returns:
TRUE on success otherwise FALSE if:
  • Empty resultset
  • An error occurred

Definition at line 1174 of file resultset.c.

OCI_EXPORT boolean OCI_API OCI_FetchSeek ( OCI_Resultset rs,
unsigned int  mode,
int  offset 
)

Custom Fetch of the resultset.

Parameters:
rs- Resultset handle
mode- Fetch direction
offset- Fetch offset
Note:
Possible values for 'direction' parameter are:
  • OCI_SFD_ABSOLUTE
  • OCI_SFD_RELATIVE
Note:
OCI_FetchSeek() works ONLY for scrollable resultsets
Returns:
TRUE on success otherwise FALSE if:
  • Empty resultset
  • An error occurred
  • OCI_SetFetchMode() has not been called with OCI_SFM_SCROLLABLE

Definition at line 1216 of file resultset.c.

OCI_EXPORT unsigned int OCI_API OCI_GetRowCount ( OCI_Resultset rs )

Retrieve the number of rows fetched so far.

Parameters:
rs- Resultset handle

Definition at line 1255 of file resultset.c.

OCI_EXPORT unsigned int OCI_API OCI_GetCurrentRow ( OCI_Resultset rs )

Retrieve the current row number.

Parameters:
rs- Resultset handle
Note:
  • OCI_GetCurrentRow() returns the current row number starting from 1
  • If the resultset has not been fetched or if the resultset is empty, it returns 0
  • If the resultset has been fully fetched, it returns the last fetched row number

Definition at line 1271 of file resultset.c.

OCI_EXPORT unsigned int OCI_API OCI_GetColumnCount ( OCI_Resultset rs )

Return the number of columns in the resultset.

Parameters:
rs- Resultset handle

Definition at line 1287 of file resultset.c.

OCI_EXPORT OCI_Column* OCI_API OCI_GetColumn ( OCI_Resultset rs,
unsigned int  index 
)

Return the column object handle at the given index in the resultset.

Parameters:
rs- Resultset handle
index- Column position
Returns:
  • Column handle on success
  • NULL if index is out of bounds or on error

Definition at line 1303 of file resultset.c.

OCI_EXPORT OCI_Column* OCI_API OCI_GetColumn2 ( OCI_Resultset rs,
const mtext *  name 
)

Return the column object handle from its name in the resultset.

Parameters:
rs- Resultset handle
name- Column name
Note:
The column name is case insensitive
Returns:
  • Column handle on success or
  • NULL if no column found with the given name or on error

Definition at line 1327 of file resultset.c.

OCI_EXPORT unsigned int OCI_API OCI_GetColumnIndex ( OCI_Resultset rs,
const mtext *  name 
)

Return the index of the column in the result from its name.

Parameters:
rs- Resultset handle
name- Column name
Note:
The column name is case insensitive
Column indexes start with 1 in OCILIB
Returns:
Column index on success or zero on error

Definition at line 1350 of file resultset.c.

OCI_EXPORT const mtext* OCI_API OCI_ColumnGetName ( OCI_Column col )

Return the name of the given column.

Parameters:
col- Column handle

Definition at line 650 of file column.c.

OCI_EXPORT unsigned int OCI_API OCI_ColumnGetType ( OCI_Column col )

Return the type of the given column.

Parameters:
col- Column handle
Note:
Possible values are :
Returns:
The column type or OCI_CDT_UNKNOWN if index is out of bounds

Definition at line 664 of file column.c.

OCI_EXPORT unsigned int OCI_API OCI_ColumnGetCharsetForm ( OCI_Column col )

Return the charset form of the given column.

Parameters:
col- Column handle
Note:
Possible values are :
  • OCI_CSF_NONE : the column is not an character or lob column
  • OCI_CSF_DEFAULT : the column has server default charset
  • OCI_CSF_NATIONAL : the column has national server charset

Definition at line 680 of file column.c.

OCI_EXPORT const mtext* OCI_API OCI_ColumnGetSQLType ( OCI_Column col )

Return the Oracle SQL type name of the column datatype.

Parameters:
col- Column handle
Note:
For possible values, consults Oracle Documentation

Definition at line 835 of file column.c.

OCI_EXPORT unsigned int OCI_API OCI_ColumnGetFullSQLType ( OCI_Column col,
mtext *  buffer,
unsigned int  len 
)

Return the Oracle SQL Full name including precision and size of the column datatype.

Parameters:
col- Column handle
buffer- buffer to store the full column type name and size
len- max size of the buffer in characters
Note:
This function returns a description that matches the one given by SQL*Plus
Return the number of characters written into the buffer

Definition at line 999 of file column.c.

OCI_EXPORT unsigned int OCI_API OCI_ColumnGetSize ( OCI_Column col )

Return the size of the column.

Note:
For all types, the size is expressed is bytes, excepted for character based columns that were created with a character based size or of type NCHAR/NVARCHAR
Parameters:
col- Column handle

Definition at line 701 of file column.c.

OCI_EXPORT int OCI_API OCI_ColumnGetScale ( OCI_Column col )

Return the scale of the column for numeric columns.

Parameters:
col- Column handle

Definition at line 728 of file column.c.

OCI_EXPORT int OCI_API OCI_ColumnGetPrecision ( OCI_Column col )

Return the precision of the column for numeric columns.

Parameters:
col- Column handle

Definition at line 744 of file column.c.

OCI_EXPORT int OCI_API OCI_ColumnGetFractionalPrecision ( OCI_Column col )

Return the fractional precision of the column for timestamp and interval columns.

Parameters:
col- Column handle

Definition at line 763 of file column.c.

OCI_EXPORT int OCI_API OCI_ColumnGetLeadingPrecision ( OCI_Column col )

Return the leading precision of the column for interval columns.

Parameters:
col- Column handle

Definition at line 784 of file column.c.

OCI_EXPORT boolean OCI_API OCI_ColumnGetNullable ( OCI_Column col )

Return the nullable attribute of the column.

Parameters:
col- Column handle
Returns:
Return TRUE if the column is nullable otherwise FALSE

Definition at line 803 of file column.c.

OCI_EXPORT boolean OCI_API OCI_ColumnGetCharUsed ( OCI_Column col )

Return TRUE if the length of the column is character-length or FALSE if it is byte-length.

Parameters:
col- Column handle
Note:
This was introduced in Oracle 9i. So for version that are not supporting this property, it always return FALSE

Definition at line 819 of file column.c.

OCI_EXPORT OCI_TypeInfo* OCI_API OCI_ColumnGetTypeInfo ( OCI_Column col )

Return the type information object associated to the column.

Parameters:
col- Column handle
Note:
This call is used only for Named Object typed and collection columns. It returns NULL if the column is not a Named Object or a collection.

Definition at line 1214 of file column.c.

OCI_EXPORT unsigned int OCI_API OCI_ColumnGetSubType ( OCI_Column col )

Return the OCILIB object subtype of a column.

Parameters:
col- Column handle
Note:

This call is valid for the following OCILIB types:

  • OCI_CDT_LONG
  • OCI_CDT_LOB
  • OCI_CDT_FILE
  • OCI_CDT_TIMESTAMP
  • OCI_CDT_INTERVAL

For OCI_Long type the possible values are:

  • OCI_BLONG
  • OCI_CLONG

For OCI_Lob type the possible values are:

  • OCI_BLOB
  • OCI_CLOB
  • OCI_NCLOB

For OCI_File type the possible values are:

  • OCI_BFILE
  • OCI_CFILE

For OCI_Timestamp type the possible values are:

  • OCI_TIMESTAMP
  • OCI_TIMESTAMP_TZ
  • OCI_TIMESTAMP_LTZ

For OCI_Interval type the possible values are:

  • OCI_INTERVAL_YM
  • OCI_INTERVAL_DS
Note:
For all other OCILIB types, it returns OCI_UNKNOWN

Definition at line 1230 of file column.c.

OCI_EXPORT boolean OCI_API OCI_SetStructNumericType ( OCI_Resultset rs,
unsigned int  index,
unsigned int  type 
)

set the numeric datatype of the given structure member (identified from position in the resultset) to retrieve when calling OCI_GetStruct()

Parameters:
rs- Resultset handle
index- Column position
type- Numeric type
Note:
Possible values for parameter 'type' :
  • OCI_NUM_SHORT
  • OCI_NUM_USHORT
  • OCI_NUM_INT
  • OCI_NUM_UINT
  • OCI_NUM_BIGINT
  • OCI_NUM_BIGUINT
  • OCI_NUM_DOUBLE
Returns:
Return TRUE on success otherwise FALSE

Definition at line 1370 of file resultset.c.

Referenced by OCI_SetStructNumericType2().

OCI_EXPORT boolean OCI_API OCI_SetStructNumericType2 ( OCI_Resultset rs,
const mtext *  name,
unsigned int  type 
)

set the numeric datatype of the given structure member (identified from column name in the resultset) to retrieve when calling OCI_GetStruct()

Parameters:
rs- Resultset handle
name- Column name
type- Numeric type
Note:
Possible values for parameter 'type' :
  • OCI_NUM_SHORT
  • OCI_NUM_USHORT
  • OCI_NUM_INT
  • OCI_NUM_UINT
  • OCI_NUM_BIGINT
  • OCI_NUM_BIGUINT
  • OCI_NUM_DOUBLE
Returns:
Return TRUE on success otherwise FALSE

Definition at line 1394 of file resultset.c.

References OCI_SetStructNumericType().

OCI_EXPORT boolean OCI_API OCI_GetStruct ( OCI_Resultset rs,
void *  row_struct,
void *  row_struct_ind 
)

Return the row columns values into a single structure.

Parameters:
rs- Resultset handle
row_struct- pointer to user row structure
row_struct_ind- pointer to user indicator structure
Note:
Structure members values are contextual to the current row. The returned values can get out of scope when the current row changes when calling any OCI_FecthXXX() calls
User row structure

The user structure must have the same members than the resultset. Each column in the resulset must have its equivalent in the structure. Fields must be in the same order.

The mapping rules are :

The user structure pointer is not mandatory

User row indicator structure

This structure must have one boolean field per column in the resulset and respect in the same member order.

If the value of the given member is TRUE, it means the value in the user row structure is NOT NULL, otherwise its NULL

The user indicator structure pointer is mandatory

Returns:
Return TRUE on success otherwise FALSE

Definition at line 1408 of file resultset.c.

References OCI_GetColl(), OCI_GetDate(), OCI_GetFile(), OCI_GetInterval(), OCI_GetLob(), OCI_GetLong(), OCI_GetObject(), OCI_GetRef(), OCI_GetStatement(), OCI_GetString(), and OCI_GetTimestamp().

OCI_EXPORT short OCI_API OCI_GetShort ( OCI_Resultset rs,
unsigned int  index 
)

Return the current short value of the column at the given index in the resultset.

Parameters:
rs- Resultset handle
index- Column position
Note:
Column position starts at 1.
Returns:
The column current row value or 0 if index is out of bounds

Definition at line 1575 of file resultset.c.

Referenced by OCI_GetShort2().

OCI_EXPORT short OCI_API OCI_GetShort2 ( OCI_Resultset rs,
const mtext *  name 
)

Return the current short value of the column from its name in the resultset.

Parameters:
rs- Resultset handle
name- Column name
Note:
The column name is case insensitive
Returns:
The column current row value or 0 if no column found with the given name

Definition at line 1592 of file resultset.c.

References OCI_GetShort().

OCI_EXPORT unsigned short OCI_API OCI_GetUnsignedShort ( OCI_Resultset rs,
unsigned int  index 
)

Return the current unsigned short value of the column at the given index in the resultset.

Parameters:
rs- Resultset handle
index- Column position
Note:
Column position starts at 1.
Returns:
The column current row value or 0 if index is out of bounds

Definition at line 1605 of file resultset.c.

Referenced by OCI_GetUnsignedShort2().

OCI_EXPORT unsigned short OCI_API OCI_GetUnsignedShort2 ( OCI_Resultset rs,
const mtext *  name 
)

Return the current unsigned short value of the column from its name in the resultset.

Parameters:
rs- Resultset handle
name- Column name
Note:
The column name is case insensitive
Returns:
The column current row value or 0 if no column found with the given name

Definition at line 1622 of file resultset.c.

References OCI_GetUnsignedShort().

OCI_EXPORT 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 resultset.

Parameters:
rs- Resultset handle
index- Column position
Note:
Column position starts at 1.
Returns:
The column current row value or 0 if index is out of bounds

Definition at line 1635 of file resultset.c.

Referenced by OCI_GetInt2().

OCI_EXPORT int OCI_API OCI_GetInt2 ( OCI_Resultset rs,
const mtext *  name 
)

Return the current integer value of the column from its name in the resultset.

Parameters:
rs- Resultset handle
name- Column name
Note:
The column name is case insensitive
Returns:
The column current row value or 0 if no column found with the given name

Definition at line 1652 of file resultset.c.

References OCI_GetInt().

OCI_EXPORT unsigned int OCI_API OCI_GetUnsignedInt ( OCI_Resultset rs,
unsigned int  index 
)

Return the current unsigned integer value of the column at the given index in the resultset.

Parameters:
rs- Resultset handle
index- Column position
Note:
Column position starts at 1.
Returns:
The column current row value or 0 if index is out of bounds

Definition at line 1665 of file resultset.c.

Referenced by OCI_GetUnsignedInt2().

OCI_EXPORT unsigned int OCI_API OCI_GetUnsignedInt2 ( OCI_Resultset rs,
const mtext *  name 
)

Return the current unsigned integer value of the column from its name in the resultset.

Parameters:
rs- Resultset handle
name- Column name
Note:
The column name is case insensitive
Returns:
The column current row value or 0 if no column found with the given name

Definition at line 1682 of file resultset.c.

References OCI_GetUnsignedInt().

OCI_EXPORT big_int OCI_API OCI_GetBigInt ( OCI_Resultset rs,
unsigned int  index 
)

Return the current big integer value of the column at the given index in the resultset.

Parameters:
rs- Resultset handle
index- Column position
Note:
Column position starts at 1.
Returns:
The column current row value or 0 if index is out of bounds

Definition at line 1695 of file resultset.c.

Referenced by OCI_GetBigInt2().

OCI_EXPORT big_int OCI_API OCI_GetBigInt2 ( OCI_Resultset rs,
const mtext *  name 
)

Return the current big integer value of the column from its name in the resultset.

Parameters:
rs- Resultset handle
name- Column name
Note:
The column name is case insensitive
Returns:
The column current row value or 0 if no column found with the given name

Definition at line 1712 of file resultset.c.

References OCI_GetBigInt().

OCI_EXPORT big_uint OCI_API OCI_GetUnsignedBigInt ( OCI_Resultset rs,
unsigned int  index 
)

Return the current unsigned big integer value of the column at the given index in the resultset.

Parameters:
rs- Resultset handle
index- Column position
Note:
Column position starts at 1.
Returns:
The column current row value or 0 if index is out of bounds

Definition at line 1725 of file resultset.c.

Referenced by OCI_GetUnsignedBigInt2().

OCI_EXPORT big_uint OCI_API OCI_GetUnsignedBigInt2 ( OCI_Resultset rs,
const mtext *  name 
)

Return the current unsigned big integer value of the column from its name in the resultset.

Parameters:
rs- Resultset handle
name- Column name
Note:
The column name is case insensitive
Returns:
The column current row value or 0 if no column found with the given name

Definition at line 1742 of file resultset.c.

References OCI_GetUnsignedBigInt().

OCI_EXPORT const dtext* OCI_API OCI_GetString ( OCI_Resultset rs,
unsigned int  index 
)

Return the current string value of the column at the given index in the resultset.

Parameters:
rs- Resultset handle
index- Column position
Note:
Column position starts at 1.
Returns:
The column current row value or NULL if index is out of bounds

Definition at line 1755 of file resultset.c.

References OCI_DateToText(), OCI_FileGetSize(), OCI_FileRead(), OCI_FileSeek(), OCI_GetDate(), OCI_GetDefaultFormatDate(), OCI_GetDefaultFormatNumeric(), OCI_GetFile(), OCI_GetInterval(), OCI_GetLob(), OCI_GetLong(), OCI_GetRef(), OCI_GetTimestamp(), OCI_IntervalToText(), OCI_LobGetLength(), OCI_LobRead(), OCI_LobSeek(), OCI_LongGetBuffer(), OCI_RefToText(), and OCI_TimestampToText().

Referenced by OCI_GetString2(), and OCI_GetStruct().

OCI_EXPORT const dtext* OCI_API OCI_GetString2 ( OCI_Resultset rs,
const mtext *  name 
)

Return the current string value of the column from its name in the resultset.

Parameters:
rs- Resultset handle
name- Column name
Note:
The column name is case insensitive
Returns:
The column current row value or NULL if no column found with the given name

Definition at line 2082 of file resultset.c.

References OCI_GetString().

OCI_EXPORT unsigned int OCI_API OCI_GetRaw ( OCI_Resultset rs,
unsigned int  index,
void *  buffer,
unsigned int  len 
)

Copy the current raw value of the column at the given index into the specified buffer.

Parameters:
rs- Resultset handle
index- Column position
buffer- Buffer that receive the raw value
len- Max size of the input buffer in bytes
Note:
Column position starts at 1.
Returns:
Number of bytes copied into the buffer on SUCCESS otherwise 0

Definition at line 2095 of file resultset.c.

Referenced by OCI_GetRaw2().

OCI_EXPORT unsigned int OCI_API OCI_GetRaw2 ( OCI_Resultset rs,
const mtext *  name,
void *  buffer,
unsigned int  len 
)

Copy the current raw value of the column from its name into the specified buffer.

Parameters:
rs- Resultset handle
name- Column name
buffer- Buffer that receive the raw value
len- Max size of the input buffer
Note:
The column name is case insensitive
Returns:
Number of bytes copied into the buffer on SUCCESS otherwise 0

Definition at line 2137 of file resultset.c.

References OCI_GetRaw().

OCI_EXPORT double OCI_API OCI_GetDouble ( OCI_Resultset rs,
unsigned int  index 
)

Return the current double value of the column at the given index in the resultset.

Parameters:
rs- Resultset handle
index- Column position
Note:
Column position starts at 1.
Returns:
The column current row value or 0.O if index is out of bounds

Definition at line 2152 of file resultset.c.

Referenced by OCI_GetDouble2().

OCI_EXPORT double OCI_API OCI_GetDouble2 ( OCI_Resultset rs,
const mtext *  name 
)

Return the current double value of the column from its name in the resultset.

Parameters:
rs- Resultset handle
name- Column name
Note:
The column name is case insensitive
Returns:
The column current row value or 0.0 if no column found with the given name

Definition at line 2169 of file resultset.c.

References OCI_GetDouble().

OCI_EXPORT OCI_Date* OCI_API OCI_GetDate ( OCI_Resultset rs,
unsigned int  index 
)

Return the current date value of the column at the given index in the resultset.

Parameters:
rs- Resultset handle
index- Column position
Note:
Column position starts at 1.
Returns:
The column current row value or NULL if index is out of bounds

Definition at line 2182 of file resultset.c.

Referenced by OCI_GetDate2(), OCI_GetString(), and OCI_GetStruct().

OCI_EXPORT OCI_Date* OCI_API OCI_GetDate2 ( OCI_Resultset rs,
const mtext *  name 
)

Return the current date value of the column from its name in the resultset.

Parameters:
rs- Resultset handle
name- Column name
Returns:
The column current row value or NULL if no column found with the given name

Definition at line 2208 of file resultset.c.

References OCI_GetDate().

OCI_EXPORT OCI_Timestamp* OCI_API OCI_GetTimestamp ( OCI_Resultset rs,
unsigned int  index 
)

Return the current timestamp value of the column at the given index in the resultset.

Parameters:
rs- Resultset handle
index- Column position
Note:
Column position starts at 1.
Returns:
The column current row value or NULL if index is out of bounds

Definition at line 2221 of file resultset.c.

Referenced by OCI_GetString(), OCI_GetStruct(), and OCI_GetTimestamp2().

OCI_EXPORT OCI_Timestamp* OCI_API OCI_GetTimestamp2 ( OCI_Resultset rs,
const mtext *  name 
)

Return the current timestamp value of the column from its name in the resultset.

Parameters:
rs- Resultset handle
name- Column name
Returns:
The column current row value or NULL if no column found with the given name

Definition at line 2247 of file resultset.c.

References OCI_GetTimestamp().

OCI_EXPORT OCI_Interval* OCI_API OCI_GetInterval ( OCI_Resultset rs,
unsigned int  index 
)

Return the current interval value of the column at the given index in the resultset.

Parameters:
rs- Resultset handle
index- Column position
Note:
Column position starts at 1.
Returns:
The column current row value or NULL if index is out of bounds

Definition at line 2260 of file resultset.c.

Referenced by OCI_GetInterval2(), OCI_GetString(), and OCI_GetStruct().

OCI_EXPORT OCI_Interval* OCI_API OCI_GetInterval2 ( OCI_Resultset rs,
const mtext *  name 
)

Return the current interval value of the column from its name in the resultset.

Parameters:
rs- Resultset handle
name- Column name
Returns:
The column current row value or NULL if no column found with the given name

Definition at line 2286 of file resultset.c.

References OCI_GetInterval().

OCI_EXPORT OCI_Statement* OCI_API OCI_GetStatement ( OCI_Resultset rs,
unsigned int  index 
)

Return the current cursor value (Nested table) of the column at the given index in the resultset.

Parameters:
rs- Resultset handle
index- Column position
Note:
Column position starts at 1.
Returns:
The column current row value or NULL if index is out of bounds

Definition at line 2422 of file resultset.c.

Referenced by OCI_GetStatement2(), and OCI_GetStruct().

OCI_EXPORT OCI_Statement* OCI_API OCI_GetStatement2 ( OCI_Resultset rs,
const mtext *  name 
)

Return the current cursor value of the column from its name in the resultset.

Parameters:
rs- Resultset handle
name- Column name
Returns:
The column current row value or NULL if no column found with the given name

Definition at line 2447 of file resultset.c.

References OCI_GetStatement().

OCI_EXPORT 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 resultset.

Parameters:
rs- Resultset handle
index- Column position
Note:
Column position starts at 1.
Returns:
The column current row value or NULL if index is out of bounds

Definition at line 2460 of file resultset.c.

Referenced by OCI_GetLob2(), OCI_GetString(), and OCI_GetStruct().

OCI_EXPORT OCI_Lob* OCI_API OCI_GetLob2 ( OCI_Resultset rs,
const mtext *  name 
)

Return the current lob value of the column from its name in the resultset.

Parameters:
rs- Resultset handle
name- Column name
Returns:
The column current row value or NULL if no column found with the given name

Definition at line 2485 of file resultset.c.

References OCI_GetLob().

OCI_EXPORT OCI_File* OCI_API OCI_GetFile ( OCI_Resultset rs,
unsigned int  index 
)

Return the current File value of the column at the given index in the resultset.

Parameters:
rs- Resultset handle
index- Column position
Note:
Column position starts at 1.
Returns:
The column current row value or NULL if index is out of bounds

Definition at line 2498 of file resultset.c.

Referenced by OCI_GetFile2(), OCI_GetString(), and OCI_GetStruct().

OCI_EXPORT OCI_File* OCI_API OCI_GetFile2 ( OCI_Resultset rs,
const mtext *  name 
)

Return the current File value of the column from its name in the resultset.

Parameters:
rs- Resultset handle
name- Column name
Returns:
The column current row value or NULL if no column found with the given name

Definition at line 2523 of file resultset.c.

References OCI_GetFile().

OCI_EXPORT OCI_Object* OCI_API OCI_GetObject ( OCI_Resultset rs,
unsigned int  index 
)

Return the current Object value of the column at the given index in the resultset.

Parameters:
rs- Resultset handle
index- Column position
Note:
Column position starts at 1.
Returns:
The column current row value or NULL if index is out of bounds

Definition at line 2299 of file resultset.c.

Referenced by OCI_GetObject2(), and OCI_GetStruct().

OCI_EXPORT OCI_Object* OCI_API OCI_GetObject2 ( OCI_Resultset rs,
const mtext *  name 
)

Return the current Object value of the column from its name in the resultset.

Parameters:
rs- Resultset handle
name- Column name
Returns:
The column current row value or NULL if no column found with the given name

Definition at line 2325 of file resultset.c.

References OCI_GetObject().

OCI_EXPORT OCI_Coll* OCI_API OCI_GetColl ( OCI_Resultset rs,
unsigned int  index 
)

Return the current Collection value of the column at the given index in the resultset.

Parameters:
rs- Resultset handle
index- Column position
Note:
Column position starts at 1.
Returns:
The column current row value or NULL if index is out of bounds

Definition at line 2338 of file resultset.c.

Referenced by OCI_GetColl2(), and OCI_GetStruct().

OCI_EXPORT OCI_Coll* OCI_API OCI_GetColl2 ( OCI_Resultset rs,
const mtext *  name 
)

Return the current Collection value of the column from its name in the resultset.

Parameters:
rs- Resultset handle
name- Column name
Returns:
The column current row value or NULL if no column found with the given name

Definition at line 2362 of file resultset.c.

References OCI_GetColl().

OCI_EXPORT OCI_Ref* OCI_API OCI_GetRef ( OCI_Resultset rs,
unsigned int  index 
)

Return the current Ref value of the column at the given index in the resultset.

Parameters:
rs- Resultset handle
index- Column position
Note:
Column position starts at 1.
Returns:
The column current row value or NULL if index is out of bounds

Definition at line 2375 of file resultset.c.

Referenced by OCI_GetRef2(), OCI_GetString(), and OCI_GetStruct().

OCI_EXPORT OCI_Ref* OCI_API OCI_GetRef2 ( OCI_Resultset rs,
const mtext *  name 
)

Return the current Ref value of the column from its name in the resultset.

Parameters:
rs- Resultset handle
name- Column name
Returns:
The column current row value or NULL if no column found with the given name

Definition at line 2409 of file resultset.c.

References OCI_GetRef().

OCI_EXPORT OCI_Long* OCI_API OCI_GetLong ( OCI_Resultset rs,
unsigned int  index 
)

Return the current Long value of the column at the given index in the resultset.

Parameters:
rs- Resultset handle
index- Column position
Note:
Column position starts at 1.
Returns:
The column current row value or NULL if index is out of bounds

Definition at line 2536 of file resultset.c.

Referenced by OCI_GetLong2(), OCI_GetString(), and OCI_GetStruct().

OCI_EXPORT OCI_Long* OCI_API OCI_GetLong2 ( OCI_Resultset rs,
const mtext *  name 
)

Return the current Long value of the column from its name in the resultset.

Parameters:
rs- Resultset handle
name- Column name
Returns:
The column current row value or NULL if no column found with the given name

Definition at line 2559 of file resultset.c.

References OCI_GetLong().

OCI_EXPORT boolean OCI_API OCI_IsNull ( OCI_Resultset rs,
unsigned int  index 
)

Check if the current row value is null for the column at the given index in the resultset.

Parameters:
rs- Resultset handle
index- Column position
Note:
Column position starts at 1.
Returns:
TRUE if it's null otherwise FALSE

Definition at line 2572 of file resultset.c.

Referenced by OCI_IsNull2().

OCI_EXPORT boolean OCI_API OCI_IsNull2 ( OCI_Resultset rs,
const mtext *  name 
)

Check if the current row value is null for the column of the given name in the resultset.

Parameters:
rs- Resultset handle
name- Column name
Returns:
TRUE if it's null otherwise FALSE

Definition at line 2589 of file resultset.c.

References OCI_IsNull().

OCI_EXPORT OCI_Statement* OCI_API OCI_ResultsetGetStatement ( OCI_Resultset rs )

Return the statement handle associated with a resultset handle.

Parameters:
rs- resultset handle

Definition at line 2602 of file resultset.c.

OCI_EXPORT unsigned int OCI_API OCI_GetDataLength ( OCI_Resultset rs,
unsigned int  index 
)

Return the current row data length of the column at the given index in the resultset.

Parameters:
rs- Resultset handle
index- Column position
Note:
Column position starts at 1.
Returns:
The column current row data length or 0 if index is out of bounds

Definition at line 2618 of file resultset.c.