Fetching data
C API

## 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 the following statements can return resultsets that can be fetched by host programs:

- Statements executing SQL SELECT
- Statements executing SQL UPDATE/DELETE using a RETURNING INTO clause
- Statements binded to PL/SQL OPEN FOR argument
- Statements binded to PL/SQL procedure OUT variables
- Statements implicitly returned from PL/SQL procedure or blocks (new feature in Oracle 12cR1) using DBMS_SQL.RETURN_RESULT()

These resultsets are encapsulated in OCILIB by OCI_Resultset objects.

Thus, 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 :

- Describing the output columns of the resultset
- Allocating memory to hold the content data

OCILIB supports multi-row fetching for increasing performances. Instead of fetching data row by row from the server (that induces lots of round-trips 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 :

- It can be fetched by calling OCI_FetchNext() as long as it returns TRUE.
- To retrieve the value of a column, call OCI_GetXXXX() where XXXX is the type of data you want to fetch.

Note
  In case of a statement that has executed PL/SQL calls or blocks returning implicit resultsets:
  - OCI_GetResultset() return the first available resultset
  - OCI_GetNextResultset() return the next available resultset until no more resultset available

Scrollable Resultsets

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

- Sequentially in both directions: OCI_FetchPrev() and OCI_FetchNext()
- To a relative position in the resultset: OCI_FetchSeek() with OCI_SFD_RELATIVE
- To an absolute position in the resultset: OCI_FetchSeek() with OCI_SFD_ABOSLUTE
- To the first or last row in the resultset: OCI_FetchFirst() and OCI_FetchLast()

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

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 set to OCI_SFM_DEFAULT will fail !
  If you intend to use OCI_FetchSeek() on a scrollable statement and if any of the selected columns is a ref cursor or a nested table, OCILIB will internally set the resultset internal array size to 1 and thus ignore any values set using OCI_SetFetchSize() This is performed due to an Oracle bug.

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 ANY Oracle types:

- Numerics (based on the current connection handle numeric format)
- Binary doubles and floats (using the standard C Library functions)
- OCI_Date : uses OCI_DateToText() with current connection date format
- OCI_Timestamp : uses OCI_TimestampToText() with current connection date format
- OCI_Interval : uses OCI_IntervalToText() with Oracle default format
- OCI_Coll : uses OCI_CollToText()
- OCI_Object : uses OCI_ObjectToText()
- OCI_Ref : uses OCI_RefToText()
- OCI_File : returns "$(folder)/$(filename)" - no content returned
- OCI_Lob : see note above for binary types
- OCI_Long : see note above for binary types
- RAWs : see note above for binary types

Note
  For RAWs and BLOBs attributes, their binary values are converted to hexadecimal strings For LONG and CLOBs/NCLOBSs attributes, the whole string content is returned
  The following OCILIB types are not supported for implicit conversion:
  - OCI_Statement

Warning
  For Dates and numerics types, OCILIB uses OCI client calls to perform the conversion. For binary double and binary floats data types, OCI client functions cannot handle the full double range of values. Thus, OCILIB is using the standard C library to convert theses data types to string

Fetching rows into user structures

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 :

- LOBs (CLOB, NCLOB, BLOB) : OCI_Lob *
- DATE : OCI_Date *
- TIMESTAMPS : OCI_Timestamp *
- INTERVALS : OCI_Interval *
- LONG, LONG RAW : OCI_Long *
- REFs : OCI_Ref *
- CURSOR, RESULSET : OCI_Statement *
- OBJECTS, UDT : OCI_Object *
- Character columns (CHAR,VARCHAR, etc..) : otext *
- All NUMERIC types :
  - default : big_int
  - user defined (see OCI_SetStructNumericType())

See OCI_GetStruct() and OCI_SetStructNumericType() for more details

Fetch Example
  #include "ocilib.h"
  /* requires script demo/products.sql */
  void err_handler(OCI_Error *err)
  {
  printf("%s\n", OCI_ErrorGetString(err));
  }
  int main(void)
  {
  OCI_Connection *cn;
  OCI_Statement *st;
  OCI_Resultset *rs;
  if (!OCI_Initialize(err_handler, 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_StatementFree(st);
  OCI_ConnectionFree(cn);
  OCI_Cleanup();
  return EXIT_SUCCESS;
  }

Fetch Rows into user structures Example
  #include "ocilib.h"
  /* requires script demo/products.sql */
  typedef struct product_t
  {
  int code;
  char *name;
  } product_t;
  typedef struct product_ind_t
  {
  boolean code;
  boolean name;
  } product_ind_t;
  void err_handler(OCI_Error *err)
  {
  printf("%s\n", OCI_ErrorGetString(err));
  }
  int main(void)
  {
  OCI_Connection *cn;
  OCI_Statement *st;
  OCI_Resultset *rs;
  product_t prd;
  product_ind_t ind;
  int i = 0;
  if (!OCI_Initialize(err_handler, 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);
  while (OCI_FetchNext(rs))
  {
  OCI_GetStruct(rs, &prd, &ind);
  printf("row #%d \n"
  " \n"
  "...prd.code : %d \n"
  "...prd.name : %s \n"
  " \n",
  ++i, prd.code, prd.name);
  }
  printf("\n\n%d row(s) fetched\n", OCI_GetRowCount(rs));
  OCI_StatementFree(st);
  OCI_ConnectionFree(cn);
  OCI_Cleanup();
  return EXIT_SUCCESS;
  }

Meta data Example
  #include "ocilib.h"
  void err_handler(OCI_Error *err)
  {
  printf("%s\n", OCI_ErrorGetString(err));
  }
  int main(void)
  {
  OCI_Connection *cn;
  OCI_Statement *st;
  OCI_Resultset *rs;
  int i, n;
  if (!OCI_Initialize(err_handler, 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 user_tables");
  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_StatementFree(st);
  OCI_ConnectionFree(cn);
  OCI_Cleanup();
  return EXIT_SUCCESS;
  }

Ref cursor Example
  #include "ocilib.h"
  void err_handler(OCI_Error *err)
  {
  printf("%s\n", OCI_ErrorGetString(err));
  }
  int main(void)
  {
  OCI_Connection *cn;
  OCI_Statement *st;
  OCI_Resultset *rs;
  if (!OCI_Initialize(err_handler, NULL, OCI_ENV_DEFAULT))
  {
  return EXIT_FAILURE;
  }
  cn = OCI_ConnectionCreate("db", "usr", "pwd", OCI_SESSION_DEFAULT);
  st = OCI_StatementCreate(cn);
  OCI_ExecuteStmt(st, "select rownum, cursor(select sysdate from dual) from (select 1 from dual connect by level <= 10)");
  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("index: %d, date: %s\n", OCI_GetInt(rs, 1), OCI_GetString(rs2, 1));
  }
  }
  OCI_StatementFree(st);
  OCI_ConnectionFree(cn);
  OCI_Cleanup();
  return EXIT_SUCCESS;
  }

Implicit resultset Example
  #include "ocilib.h"
  void err_handler(OCI_Error *err)
  {
  printf("%s\n", OCI_ErrorGetString(err));
  }
  int main(void)
  {
  OCI_Connection *cn;
  OCI_Statement *st;
  OCI_Resultset *rs;
  int nb_rs = 0;
  if (!OCI_Initialize(err_handler, NULL, OCI_ENV_DEFAULT))
  {
  return EXIT_FAILURE;
  }
  cn = OCI_ConnectionCreate("db", "usr", "pwd", OCI_SESSION_DEFAULT);
  st = OCI_StatementCreate(cn);
  OCI_ExecuteStmt(st,
  "declare"
  " c1 sys_refcursor;"
  " c2 sys_refcursor;"
  " begin"
  " open c1 for select * from tabs;"
  " dbms_sql.return_result (c1); "
  " open c2 for select * from cols;"
  " dbms_sql.return_result (c2); "
  "end;");
  rs = OCI_GetResultset(st);
  while (rs)
  {
  printf("Iterating on resultset #%d\n", ++nb_rs);
  while (OCI_FetchNext(rs))
  {
  printf("...%s\n", OCI_GetString(rs, 1));
  }
  rs = OCI_GetNextResultset(st);
  }
  printf("\nFound %d resultsets\n", nb_rs);
  OCI_StatementFree(st);
  OCI_ConnectionFree(cn);
  OCI_Cleanup();
  return EXIT_SUCCESS;
  }

Scrollable resultset Example
  #include "ocilib.h"
  void err_handler(OCI_Error *err)
  {
  printf("%s\n", OCI_ErrorGetString(err));
  }
  int main(void)
  {
  OCI_Connection *cn;
  OCI_Statement *st;
  OCI_Resultset *rs;
  if (!OCI_Initialize(err_handler, 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 rownum, 'Row ' || rownum from (select 1 from dual connect by level <= 65)");
  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_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_StatementFree(st);
  OCI_ConnectionFree(cn);
  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. More...
OCI_EXPORT boolean OCI_API | OCI_ReleaseResultsets (OCI_Statement *stmt)
| Free the statement resultsets. More...
OCI_EXPORT boolean OCI_API | OCI_FetchNext (OCI_Resultset *rs)
| Fetch the next row of the resultset. More...
OCI_EXPORT boolean OCI_API | OCI_FetchPrev (OCI_Resultset *rs)
| Fetch the previous row of the resultset. More...
OCI_EXPORT boolean OCI_API | OCI_FetchFirst (OCI_Resultset *rs)
| Fetch the first row of the resultset. More...
OCI_EXPORT boolean OCI_API | OCI_FetchLast (OCI_Resultset *rs)
| Fetch the last row of the resultset. More...
OCI_EXPORT boolean OCI_API | OCI_FetchSeek (OCI_Resultset *rs, unsigned int mode, int offset)
| Custom Fetch of the resultset. More...
OCI_EXPORT unsigned int OCI_API | OCI_GetRowCount (OCI_Resultset *rs)
| Retrieve the number of rows fetched so far. More...
OCI_EXPORT unsigned int OCI_API | OCI_GetCurrentRow (OCI_Resultset *rs)
| Retrieve the current row number. More...
OCI_EXPORT unsigned int OCI_API | OCI_GetColumnCount (OCI_Resultset *rs)
| Return the number of columns in the resultset. More...
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. More...
OCI_EXPORT OCI_Column *OCI_API | OCI_GetColumn2 (OCI_Resultset *rs, const otext *name)
| Return the column object handle from its name in the resultset. More...
OCI_EXPORT unsigned int OCI_API | OCI_GetColumnIndex (OCI_Resultset *rs, const otext *name)
| Return the index of the column in the result from its name. More...
OCI_EXPORT const otext *OCI_API | OCI_ColumnGetName (OCI_Column *col)
| Return the name of the given column. More...
OCI_EXPORT unsigned int OCI_API | OCI_ColumnGetType (OCI_Column *col)
| Return the type of the given column. More...
OCI_EXPORT unsigned int OCI_API | OCI_ColumnGetCharsetForm (OCI_Column *col)
| Return the charset form of the given column. More...
OCI_EXPORT const otext *OCI_API | OCI_ColumnGetSQLType (OCI_Column *col)
| Return the Oracle SQL type name of the column data type. More...
OCI_EXPORT unsigned int OCI_API | OCI_ColumnGetFullSQLType (OCI_Column *col, otext *buffer, unsigned int len)
| Return the Oracle SQL Full name including precision and size of the column data type. More...
OCI_EXPORT unsigned int OCI_API | OCI_ColumnGetSize (OCI_Column *col)
| Return the size of the column. More...
OCI_EXPORT int OCI_API | OCI_ColumnGetScale (OCI_Column *col)
| Return the scale of the column for numeric columns. More...
OCI_EXPORT int OCI_API | OCI_ColumnGetPrecision (OCI_Column *col)
| Return the precision of the column for numeric columns. More...
OCI_EXPORT int OCI_API | OCI_ColumnGetFractionalPrecision (OCI_Column *col)
| Return the fractional precision of the column for timestamp and interval columns. More...
OCI_EXPORT int OCI_API | OCI_ColumnGetLeadingPrecision (OCI_Column *col)
| Return the leading precision of the column for interval columns. More...
OCI_EXPORT boolean OCI_API | OCI_ColumnGetNullable (OCI_Column *col)
| Return the nullable attribute of the column. More...
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. More...
OCI_EXPORT unsigned int OCI_API | OCI_ColumnGetPropertyFlags (OCI_Column *col)
| Return the column property flags. More...
OCI_EXPORT unsigned int OCI_API | OCI_ColumnGetCollationID (OCI_Column *col)
| Return the column collation ID. More...
OCI_EXPORT OCI_TypeInfo *OCI_API | OCI_ColumnGetTypeInfo (OCI_Column *col)
| Return the type information object associated to the column. More...
OCI_EXPORT unsigned int OCI_API | OCI_ColumnGetSubType (OCI_Column *col)
| Return the OCILIB object subtype of a column. More...
OCI_EXPORT boolean OCI_API | OCI_SetStructNumericType (OCI_Resultset *rs, unsigned int index, unsigned int type)
| set the numeric data type of the given structure member (identified from position in the resultset) to retrieve when calling OCI_GetStruct() More...
OCI_EXPORT boolean OCI_API | OCI_SetStructNumericType2 (OCI_Resultset *rs, const otext *name, unsigned int type)
| set the numeric data type of the given structure member (identified from column name in the resultset) to retrieve when calling OCI_GetStruct() More...
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. More...
OCI_EXPORT OCI_Number *OCI_API | OCI_GetNumber (OCI_Resultset *rs, unsigned int index)
| Return the current Number value of the column at the given index in the resultset. More...
OCI_EXPORT OCI_Number *OCI_API | OCI_GetNumber2 (OCI_Resultset *rs, const otext *name)
| Return the current number value of the column from its name in the resultset. More...
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. More...
OCI_EXPORT short OCI_API | OCI_GetShort2 (OCI_Resultset *rs, const otext *name)
| Return the current short value of the column from its name in the resultset. More...
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. More...
OCI_EXPORT unsigned short OCI_API | OCI_GetUnsignedShort2 (OCI_Resultset *rs, const otext *name)
| Return the current unsigned short value of the column from its name in the resultset. More...
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. More...
OCI_EXPORT int OCI_API | OCI_GetInt2 (OCI_Resultset *rs, const otext *name)
| Return the current integer value of the column from its name in the resultset. More...
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. More...
OCI_EXPORT unsigned int OCI_API | OCI_GetUnsignedInt2 (OCI_Resultset *rs, const otext *name)
| Return the current unsigned integer value of the column from its name in the resultset. More...
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. More...
OCI_EXPORT big_int OCI_API | OCI_GetBigInt2 (OCI_Resultset *rs, const otext *name)
| Return the current big integer value of the column from its name in the resultset. More...
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. More...
OCI_EXPORT big_uint OCI_API | OCI_GetUnsignedBigInt2 (OCI_Resultset *rs, const otext *name)
| Return the current unsigned big integer value of the column from its name in the resultset. More...
OCI_EXPORT const otext *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. More...
OCI_EXPORT const otext *OCI_API | OCI_GetString2 (OCI_Resultset *rs, const otext *name)
| Return the current string value of the column from its name in the resultset. More...
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. More...
OCI_EXPORT unsigned int OCI_API | OCI_GetRaw2 (OCI_Resultset *rs, const otext *name, void *buffer, unsigned int len)
| Copy the current raw value of the column from its name into the specified buffer. More...
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. More...
OCI_EXPORT double OCI_API | OCI_GetDouble2 (OCI_Resultset *rs, const otext *name)
| Return the current double value of the column from its name in the resultset. More...
OCI_EXPORT float OCI_API | OCI_GetFloat (OCI_Resultset *rs, unsigned int index)
| Return the current float value of the column at the given index in the resultset. More...
OCI_EXPORT float OCI_API | OCI_GetFloat2 (OCI_Resultset *rs, const otext *name)
| Return the current float value of the column from its name in the resultset. More...
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. More...
OCI_EXPORT OCI_Date *OCI_API | OCI_GetDate2 (OCI_Resultset *rs, const otext *name)
| Return the current date value of the column from its name in the resultset. More...
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. More...
OCI_EXPORT OCI_Timestamp *OCI_API | OCI_GetTimestamp2 (OCI_Resultset *rs, const otext *name)
| Return the current timestamp value of the column from its name in the resultset. More...
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. More...
OCI_EXPORT OCI_Interval *OCI_API | OCI_GetInterval2 (OCI_Resultset *rs, const otext *name)
| Return the current interval value of the column from its name in the resultset. More...
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. More...
OCI_EXPORT OCI_Statement *OCI_API | OCI_GetStatement2 (OCI_Resultset *rs, const otext *name)
| Return the current cursor value of the column from its name in the resultset. More...
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. More...
OCI_EXPORT OCI_Lob *OCI_API | OCI_GetLob2 (OCI_Resultset *rs, const otext *name)
| Return the current lob value of the column from its name in the resultset. More...
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. More...
OCI_EXPORT OCI_File *OCI_API | OCI_GetFile2 (OCI_Resultset *rs, const otext *name)
| Return the current File value of the column from its name in the resultset. More...
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. More...
OCI_EXPORT OCI_Object *OCI_API | OCI_GetObject2 (OCI_Resultset *rs, const otext *name)
| Return the current Object value of the column from its name in the resultset. More...
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. More...
OCI_EXPORT OCI_Coll *OCI_API | OCI_GetColl2 (OCI_Resultset *rs, const otext *name)
| Return the current Collection value of the column from its name in the resultset. More...
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. More...
OCI_EXPORT OCI_Ref *OCI_API | OCI_GetRef2 (OCI_Resultset *rs, const otext *name)
| Return the current Ref value of the column from its name in the resultset. More...
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. More...
OCI_EXPORT OCI_Long *OCI_API | OCI_GetLong2 (OCI_Resultset *rs, const otext *name)
| Return the current Long value of the column from its name in the resultset. More...
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. More...
OCI_EXPORT unsigned int OCI_API | OCI_GetDataSize (OCI_Resultset *rs, unsigned int index)
| Return the size of the value of the column at the given index in the resultset. More...
OCI_EXPORT unsigned int OCI_API | OCI_GetDataSize2 (OCI_Resultset *rs, const otext *name)
| Return the size of the value of the column from its name in the resultset. More...
OCI_EXPORT boolean OCI_API | OCI_IsNull2 (OCI_Resultset *rs, const otext *name)
| Check if the current row value is null for the column of the given name in the resultset. More...
OCI_EXPORT OCI_Statement *OCI_API | OCI_ResultsetGetStatement (OCI_Resultset *rs)
| Return the statement handle associated with a resultset handle. More...
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. More...

## Function Documentation

## OCI_GetResultset()

OCI_EXPORT OCI_Resultset* OCI_API OCI_GetResultset | ( | OCI_Statement * | stmt | ) |

`#include <ocilib.h>`

Retrieve the resultset handle from an executed statement.

Parameters

  stmt | - Statement handle

Note
  See Fetching data for more details about what statements can return resultsets

Warning
  If the statement has not been prepared and executed, no resultset will be returned

Returns
  A resultset handle on success otherwise NULL

Referenced by ocilib::Statement::GetResultset().

## OCI_ReleaseResultsets()

OCI_EXPORT boolean OCI_API OCI_ReleaseResultsets | ( | OCI_Statement * | stmt | ) |

`#include <ocilib.h>`

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

## OCI_FetchNext()

OCI_EXPORT boolean OCI_API OCI_FetchNext | ( | OCI_Resultset * | rs | ) |

`#include <ocilib.h>`

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

Referenced by ocilib::Resultset::Next().

## OCI_FetchPrev()

OCI_EXPORT boolean OCI_API OCI_FetchPrev | ( | OCI_Resultset * | rs | ) |

`#include <ocilib.h>`

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

Referenced by ocilib::Resultset::Prev().

## OCI_FetchFirst()

OCI_EXPORT boolean OCI_API OCI_FetchFirst | ( | OCI_Resultset * | rs | ) |

`#include <ocilib.h>`

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 f

Referenced by ocilib::Resultset::First().

## OCI_FetchLast()

OCI_EXPORT boolean OCI_API OCI_FetchLast | ( | OCI_Resultset * | rs | ) |

`#include <ocilib.h>`

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

Referenced by ocilib::Resultset::Last().

## OCI_FetchSeek()

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

`#include <ocilib.h>`

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
  OCI_FetchSeek() works ONLY for scrollable resultsets

Warning
  If you intend to use OCI_FetchSeek() on a scrollable statement and if any of the selected columns is a ref cursor or a nested table, you must set the fetching size to 1 using OCI_SetFetchSize() before calling OCI_GetResultset() Otherwise OCI_FetchSeek() will fails with a OCI-10002 error

Returns
  TRUE on success otherwise FALSE if:
  - Empty resultset
  - An error occurred
  - OCI_SetFetchMode() has not been called with OCI_SFM_SCROLLABLE

Referenced by ocilib::Resultset::Seek().

## OCI_GetRowCount()

OCI_EXPORT unsigned int OCI_API OCI_GetRowCount | ( | OCI_Resultset * | rs | ) |

`#include <ocilib.h>`

Retrieve the number of rows fetched so far.

Parameters

  rs | - Resultset handle

Referenced by ocilib::Resultset::GetCount().

## OCI_GetCurrentRow()

OCI_EXPORT unsigned int OCI_API OCI_GetCurrentRow | ( | OCI_Resultset * | rs | ) |

`#include <ocilib.h>`

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

Referenced by ocilib::Resultset::GetCurrentRow().

## OCI_GetColumnCount()

OCI_EXPORT unsigned int OCI_API OCI_GetColumnCount | ( | OCI_Resultset * | rs | ) |

`#include <ocilib.h>`

Return the number of columns in the resultset.

Parameters

  rs | - Resultset handle

Referenced by ocilib::Resultset::GetColumnCount().

## OCI_GetColumn()

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

`#include <ocilib.h>`

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

Referenced by ocilib::Resultset::GetColumn().

## OCI_GetColumn2()

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

`#include <ocilib.h>`

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

Referenced by ocilib::Resultset::GetColumn().

## OCI_GetColumnIndex()

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

`#include <ocilib.h>`

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

Referenced by ocilib::Resultset::ForEach(), and ocilib::Resultset::GetColumnIndex().

## OCI_ColumnGetName()

OCI_EXPORT const otext* OCI_API OCI_ColumnGetName | ( | OCI_Column * | col | ) |

`#include <ocilib.h>`

Return the name of the given column.

Parameters

  col | - Column handle

Referenced by ocilib::Resultset::Get().

## OCI_ColumnGetType()

OCI_EXPORT unsigned int OCI_API OCI_ColumnGetType | ( | OCI_Column * | col | ) |

`#include <ocilib.h>`

Return the type of the given column.

Parameters

  col | - Column handle

Note
  Possible values are :

- OCI_CDT_NUMERIC : short, int, long long, float, double
- OCI_CDT_DATETIME : OCI_Date *
- OCI_CDT_TEXT : otext *
- OCI_CDT_LONG : OCI_Long *
- OCI_CDT_CURSOR : OCI_Statement *
- OCI_CDT_LOB : OCI_Lob *
- OCI_CDT_FILE : OCI_File *
- OCI_CDT_TIMESTAMP : OCI_Timestamp *
- OCI_CDT_INTERVAL : OCI_Interval *
- OCI_CDT_RAW : void *
- OCI_CDT_OBJECT : OCI_Object *
- OCI_CDT_COLLECTION : OCI_Coll *
- OCI_CDT_REF : OCI_Ref *
- OCI_CDT_BOOLEAN : boolean

Returns
  The column type or OCI_CDT_UNKNOWN if index is out of bounds

Referenced by ocilib::Column::GetType().

## OCI_ColumnGetCharsetForm()

OCI_EXPORT unsigned int OCI_API OCI_ColumnGetCharsetForm | ( | OCI_Column * | col | ) |

`#include <ocilib.h>`

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

Referenced by ocilib::Column::GetCharsetForm().

## OCI_ColumnGetSQLType()

OCI_EXPORT const otext* OCI_API OCI_ColumnGetSQLType | ( | OCI_Column * | col | ) |

`#include <ocilib.h>`

Return the Oracle SQL type name of the column data type.

Parameters

  col | - Column handle

Note
  For possible values, consults Oracle Documentation

Referenced by ocilib::Column::GetSQLType().

## OCI_ColumnGetFullSQLType()

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

`#include <ocilib.h>`

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

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

Referenced by ocilib::Column::GetFullSQLType().

## OCI_ColumnGetSize()

OCI_EXPORT unsigned int OCI_API OCI_ColumnGetSize | ( | OCI_Column * | col | ) |

`#include <ocilib.h>`

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

Referenced by ocilib::Column::GetSize().

## OCI_ColumnGetScale()

OCI_EXPORT int OCI_API OCI_ColumnGetScale | ( | OCI_Column * | col | ) |

`#include <ocilib.h>`

Return the scale of the column for numeric columns.

Parameters

  col | - Column handle

Referenced by ocilib::Column::GetScale().

## OCI_ColumnGetPrecision()

OCI_EXPORT int OCI_API OCI_ColumnGetPrecision | ( | OCI_Column * | col | ) |

`#include <ocilib.h>`

Return the precision of the column for numeric columns.

Parameters

  col | - Column handle

Referenced by ocilib::Column::GetPrecision().

## OCI_ColumnGetFractionalPrecision()

OCI_EXPORT int OCI_API OCI_ColumnGetFractionalPrecision | ( | OCI_Column * | col | ) |

`#include <ocilib.h>`

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

Parameters

  col | - Column handle

Referenced by ocilib::Column::GetFractionalPrecision().

## OCI_ColumnGetLeadingPrecision()

OCI_EXPORT int OCI_API OCI_ColumnGetLeadingPrecision | ( | OCI_Column * | col | ) |

`#include <ocilib.h>`

Return the leading precision of the column for interval columns.

Parameters

  col | - Column handle

Referenced by ocilib::Column::GetLeadingPrecision().

## OCI_ColumnGetNullable()

OCI_EXPORT boolean OCI_API OCI_ColumnGetNullable | ( | OCI_Column * | col | ) |

`#include <ocilib.h>`

Return the nullable attribute of the column.

Parameters

  col | - Column handle

Returns
  Return TRUE if the column is nullable otherwise FALSE

Referenced by ocilib::Column::IsNullable().

## OCI_ColumnGetCharUsed()

OCI_EXPORT boolean OCI_API OCI_ColumnGetCharUsed | ( | OCI_Column * | col | ) |

`#include <ocilib.h>`

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

Referenced by ocilib::Column::IsCharSemanticUsed().

## OCI_ColumnGetPropertyFlags()

OCI_EXPORT unsigned int OCI_API OCI_ColumnGetPropertyFlags | ( | OCI_Column * | col | ) |

`#include <ocilib.h>`

Return the column property flags.

Parameters

  col | - Column handle

For flags are:

- OCI_CPF_NONE : The column has no flags or the OCI client does not support this call
- OCI_CPF_IS_IDENTITY :
  - If Set, the column is an IDENTITY column
  - Otherwise, it is not an IDENTITY column
- OCI_CPF_IS_GEN_ALWAYS (only if OCI_CPF_IS_IDENTITY is set) :
  - If set, means that the value is "ALWAYS GENERATED"
  - Otherwise mens that the value is "GENERATED BY"
- OCI_CPF_IS_GEN_BY_DEFAULT_ON_NULL (only if OCI_CPF_IS_IDENTITY is set):
  - If set, means that the value is generated by default on NULL

Note
  This was introduced in Oracle 12cR1. It is currently used for identifying Identity columns. For earlier versions, it always return OCI_CPF_NONE

Referenced by ocilib::Column::GetPropertyFlags().

## OCI_ColumnGetCollationID()

OCI_EXPORT unsigned int OCI_API OCI_ColumnGetCollationID | ( | OCI_Column * | col | ) |

`#include <ocilib.h>`

Return the column collation ID.

Parameters

  col | - Column handle

Possible values:

- OCI_CCI_NONE
- OCI_CCI_NLS_COMP
- OCI_CCI_NLS_SORT
- OCI_CCI_NLS_SORT_CI
- OCI_CCI_NLS_SORT_AI
- OCI_CCI_NLS_SORT_CS
- OCI_CCI_NLS_SORT_VAR1
- OCI_CCI_NLS_SORT_VAR1_CI
- OCI_CCI_NLS_SORT_VAR1_AI
- OCI_CCI_NLS_SORT_VAR1_CS
- OCI_CCI_BINARY
- OCI_CCI_BINARY_CI
- OCI_CCI_BINARY_AI

Note
  This was introduced in Oracle 12cR2. For earlier versions, it always return OCI_CCI_NONE

## OCI_ColumnGetTypeInfo()

OCI_EXPORT OCI_TypeInfo* OCI_API OCI_ColumnGetTypeInfo | ( | OCI_Column * | col | ) |

`#include <ocilib.h>`

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.

Referenced by ocilib::Column::GetTypeInfo().

## OCI_ColumnGetSubType()

OCI_EXPORT unsigned int OCI_API OCI_ColumnGetSubType | ( | OCI_Column * | col | ) |

`#include <ocilib.h>`

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
- OCI_CDT_NUMERIC

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

For numeric columns the possible values are:

- OCI_NUM_SHORT
- OCI_NUM_INT
- OCI_NUM_BIGINT
- OCI_NUM_USHORT
- OCI_NUM_UINT
- OCI_NUM_BIGUINT
- OCI_NUM_DOUBLE
- OCI_NUM_FLOAT
- OCI_NUM_NUMBER

Warning
  For numeric columns, the value may be not accurate at all! OCI does not allow to find out the real SQL precise type of an numeric column (int, real, ...). OCI based libraries can only 'guess' some types in some situations : float, binary_float, binary_float, number. For example:
  - with the statement 'select 101 from dual', OCI would report numeric type NUMBER.
  - if a column is declared as "INT", OCI would report also NUMBER.

Note
  For all other OCILIB types, it returns OCI_UNKNOWN

Referenced by ocilib::Column::GetSubType().

## OCI_SetStructNumericType()

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

`#include <ocilib.h>`

set the numeric data type 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
  - OCI_NUM_FLOAT
  - OCI_NUM_NUMBER

Returns
  Return TRUE on success otherwise FALSE

## OCI_SetStructNumericType2()

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

`#include <ocilib.h>`

set the numeric data type 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
  - OCI_NUM_FLOAT
  - OCI_NUM_NUMBER

Returns
  Return TRUE on success otherwise FALSE

## OCI_GetStruct()

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

`#include <ocilib.h>`

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 resultset must have its equivalent in the structure. Fields must be in the same order.

The mapping rules are :

- LOBs (CLOB, NCLOB, BLOB) : OCI_Lob *
- DATE : OCI_Date *
- TIMESTAMPS : OCI_Timestamp *
- INTERVALS : OCI_Interval *
- LONG, LONG RAW : OCI_Long *
- REFs : OCI_Ref *
- CURSOR, RESULSET : OCI_Statement *
- OBJECTS, UDT : OCI_Object *
- Character columns (CHAR,VARCHAR, etc..) : otext *
- All NUMERIC types :
  - default : big_int
  - user defined (see OCI_SetStructNumericType())

The user structure pointer is not mandatory

User row indicator structure

This structure must have one boolean field per column in the resultset 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

## OCI_GetNumber()

OCI_EXPORT OCI_Number* OCI_API OCI_GetNumber | ( | OCI_Resultset * | rs,
|  | unsigned int | index
| ) |  |

`#include <ocilib.h>`

Return the current Number 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

Referenced by ocilib::Resultset::ForEach().

## OCI_GetNumber2()

OCI_EXPORT OCI_Number* OCI_API OCI_GetNumber2 | ( | OCI_Resultset * | rs,
|  | const otext * | name
| ) |  |

`#include <ocilib.h>`

Return the current number 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

Referenced by ocilib::Resultset::ForEach().

## OCI_GetShort()

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

`#include <ocilib.h>`

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

Referenced by ocilib::Resultset::ForEach().

## OCI_GetShort2()

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

`#include <ocilib.h>`

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

Referenced by ocilib::Resultset::ForEach().

## OCI_GetUnsignedShort()

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

`#include <ocilib.h>`

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

Referenced by ocilib::Resultset::ForEach().

## OCI_GetUnsignedShort2()

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

`#include <ocilib.h>`

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

Referenced by ocilib::Resultset::ForEach().

## OCI_GetInt()

OCI_EXPORT int OCI_API OCI_GetInt | ( | OCI_Resultset * | rs,
|  | unsigned int | index
| ) |  |

`#include <ocilib.h>`

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

Referenced by ocilib::Resultset::ForEach().

## OCI_GetInt2()

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

`#include <ocilib.h>`

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

Referenced by ocilib::Resultset::ForEach().

## OCI_GetUnsignedInt()

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

`#include <ocilib.h>`

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

Referenced by ocilib::Resultset::ForEach().

## OCI_GetUnsignedInt2()

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

`#include <ocilib.h>`

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

Referenced by ocilib::Resultset::ForEach().

## OCI_GetBigInt()

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

`#include <ocilib.h>`

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

Referenced by ocilib::Resultset::ForEach().

## OCI_GetBigInt2()

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

`#include <ocilib.h>`

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

Referenced by ocilib::Resultset::ForEach().

## OCI_GetUnsignedBigInt()

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

`#include <ocilib.h>`

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

Referenced by ocilib::Resultset::ForEach().

## OCI_GetUnsignedBigInt2()

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

`#include <ocilib.h>`

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

Referenced by ocilib::Resultset::ForEach().

## OCI_GetString()

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

`#include <ocilib.h>`

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.
  OCI_GetString() performs an implicit conversion from the following data types:

- Numerics (based on the current connection handle numeric format)
- Binary doubles and floats (using the standard C Library functions)
- OCI_Number (based on the current connection handle numeric format)
- OCI_Date (based on the current connection handle date format)
- OCI_Timestamp (based on the current connection handle date format)
- OCI_Interval (based on Oracle default conversion)
- OCI_Lob (for BLOBs, output is expressed in hexadecimal)
- OCI_Long (for BLONGs, output is expressed in hexadecimal)
- OCI_File ("[directory]/[name]" will be output)
- OCI_Object (Textual SQL string representation)
- OCI_Coll (Textual SQL string representation)
- RAW buffer (expressed in hexadecimal)
- OCI_Statement (SQL statement string or cursor name)

Returns
  The column current row value or NULL if index is out of bounds

Referenced by ocilib::Resultset::ForEach().

## OCI_GetString2()

OCI_EXPORT const otext* OCI_API OCI_GetString2 | ( | OCI_Resultset * | rs,
|  | const otext * | name
| ) |  |

`#include <ocilib.h>`

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

Referenced by ocilib::Resultset::ForEach().

## OCI_GetRaw()

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

`#include <ocilib.h>`

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

Referenced by ocilib::Resultset::ForEach().

## OCI_GetRaw2()

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

`#include <ocilib.h>`

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

Referenced by ocilib::Resultset::ForEach().

## OCI_GetDouble()

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

`#include <ocilib.h>`

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

Referenced by ocilib::Resultset::ForEach().

## OCI_GetDouble2()

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

`#include <ocilib.h>`

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

Referenced by ocilib::Resultset::ForEach().

## OCI_GetFloat()

OCI_EXPORT float OCI_API OCI_GetFloat | ( | OCI_Resultset * | rs,
|  | unsigned int | index
| ) |  |

`#include <ocilib.h>`

Return the current float 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

Referenced by ocilib::Resultset::ForEach().

## OCI_GetFloat2()

OCI_EXPORT float OCI_API OCI_GetFloat2 | ( | OCI_Resultset * | rs,
|  | const otext * | name
| ) |  |

`#include <ocilib.h>`

Return the current float 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

Referenced by ocilib::Resultset::ForEach().

## OCI_GetDate()

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

`#include <ocilib.h>`

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

Referenced by ocilib::Resultset::ForEach().

## OCI_GetDate2()

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

`#include <ocilib.h>`

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

Referenced by ocilib::Resultset::ForEach().

## OCI_GetTimestamp()

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

`#include <ocilib.h>`

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

Referenced by ocilib::Resultset::ForEach().

## OCI_GetTimestamp2()

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

`#include <ocilib.h>`

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

Referenced by ocilib::Resultset::ForEach().

## OCI_GetInterval()

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

`#include <ocilib.h>`

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

Referenced by ocilib::Resultset::ForEach().

## OCI_GetInterval2()

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

`#include <ocilib.h>`

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

Referenced by ocilib::Resultset::ForEach().

## OCI_GetStatement()

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

`#include <ocilib.h>`

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

Referenced by ocilib::Resultset::ForEach().

## OCI_GetStatement2()

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

`#include <ocilib.h>`

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

Referenced by ocilib::Resultset::ForEach().

## OCI_GetLob()

OCI_EXPORT OCI_Lob* OCI_API OCI_GetLob | ( | OCI_Resultset * | rs,
|  | unsigned int | index
| ) |  |

`#include <ocilib.h>`

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

Referenced by ocilib::Resultset::ForEach().

## OCI_GetLob2()

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

`#include <ocilib.h>`

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

Referenced by ocilib::Resultset::ForEach().

## OCI_GetFile()

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

`#include <ocilib.h>`

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

Referenced by ocilib::Resultset::ForEach().

## OCI_GetFile2()

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

`#include <ocilib.h>`

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

Referenced by ocilib::Resultset::ForEach().

## OCI_GetObject()

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

`#include <ocilib.h>`

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

Referenced by ocilib::Resultset::ForEach().

## OCI_GetObject2()

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

`#include <ocilib.h>`

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

Referenced by ocilib::Resultset::ForEach().

## OCI_GetColl()

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

`#include <ocilib.h>`

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

Referenced by ocilib::Resultset::Get().

## OCI_GetColl2()

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

`#include <ocilib.h>`

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

Referenced by ocilib::Resultset::Get().

## OCI_GetRef()

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

`#include <ocilib.h>`

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

Referenced by ocilib::Resultset::ForEach().

## OCI_GetRef2()

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

`#include <ocilib.h>`

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

Referenced by ocilib::Resultset::ForEach().

## OCI_GetLong()

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

`#include <ocilib.h>`

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

Referenced by ocilib::Resultset::ForEach().

## OCI_GetLong2()

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

`#include <ocilib.h>`

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

Referenced by ocilib::Resultset::ForEach().

## OCI_IsNull()

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

`#include <ocilib.h>`

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

Referenced by ocilib::Resultset::IsColumnNull().

## OCI_GetDataSize()

OCI_EXPORT unsigned int OCI_API OCI_GetDataSize | ( | OCI_Resultset * | rs,
|  | unsigned int | index
| ) |  |

`#include <ocilib.h>`

Return the size of the value of the column at the given index in the resultset.

Parameters

  rs | - Resultset handle
  index | - Column position

Note
  Column position starts at 1.

Warning
  For binds of type OCI_CDT_TEXT (strings), the returned value is expressed in number of characters.

Returns
  value size of 0 if the value is NULL

## OCI_GetDataSize2()

OCI_EXPORT unsigned int OCI_API OCI_GetDataSize2 | ( | OCI_Resultset * | rs,
|  | const otext * | name
| ) |  |

`#include <ocilib.h>`

Return the size of the value of the column from its name in the resultset.

Parameters

  rs | - Resultset handle
  name | - Column name

Warning
  For binds of type OCI_CDT_TEXT (strings), the returned value is expressed in number of characters.

Returns
  value size of 0 if the value is NULL

## OCI_IsNull2()

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

`#include <ocilib.h>`

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

Referenced by ocilib::Resultset::IsColumnNull().

## OCI_ResultsetGetStatement()

OCI_EXPORT OCI_Statement* OCI_API OCI_ResultsetGetStatement | ( | OCI_Resultset * | rs | ) |

`#include <ocilib.h>`

Return the statement handle associated with a resultset handle.

Parameters

  rs | - resultset handle

Referenced by ocilib::Resultset::GetStatement().

## OCI_GetDataLength()

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

`#include <ocilib.h>`

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

Referenced by ocilib::Resultset::ForEach().