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 chunk (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 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.
The following type are not supported for implicit conversion :
#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; }
#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; }
#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; }
#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 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. |
OCI_EXPORT unsigned int OCI_API OCI_ColumnGetCharsetForm | ( | OCI_Column * | col | ) |
Return the charset form of the given column.
col | - Column handle |
Definition at line 614 of file column.c.
References OCI_Column::csfrm.
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.
col | - Column handle |
Definition at line 732 of file column.c.
References OCI_Column::charused.
OCI_EXPORT int OCI_API OCI_ColumnGetFractionalPrecision | ( | OCI_Column * | col | ) |
Return the fractional precision of the column for timestamp and interval columns.
col | - Column handle |
Definition at line 685 of file column.c.
References OCI_Column::prec, OCI_Column::prec2, and OCI_Column::type.
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.
col | - Column handle | |
buffer | - buffer to store the full column type name and size | |
len | - max size of the buffer in characters |
Return the number of characters written into the buffer
Definition at line 905 of file column.c.
References OCI_Column::charsize, OCI_Column::charused, OCI_Column::csfrm, OCI_TypeInfo::name, OCI_Column::ocode, OCI_Column::prec, OCI_Column::prec2, OCI_Column::scale, OCI_Column::size, OCI_Column::subtype, and OCI_Column::typinf.
OCI_EXPORT int OCI_API OCI_ColumnGetLeadingPrecision | ( | OCI_Column * | col | ) |
Return the leading precision of the column for interval columns.
col | - Column handle |
Definition at line 703 of file column.c.
References OCI_Column::prec, and OCI_Column::type.
OCI_EXPORT const mtext* OCI_API OCI_ColumnGetName | ( | OCI_Column * | col | ) |
Return the name of the given column.
col | - Column handle |
Definition at line 590 of file column.c.
References OCI_Column::name.
OCI_EXPORT boolean OCI_API OCI_ColumnGetNullable | ( | OCI_Column * | col | ) |
Return the nullable attribute of the column.
col | - Column handle |
Definition at line 719 of file column.c.
References OCI_Column::null.
OCI_EXPORT int OCI_API OCI_ColumnGetPrecision | ( | OCI_Column * | col | ) |
Return the precision of the column for numeric columns.
col | - Column handle |
Definition at line 669 of file column.c.
References OCI_Column::prec, and OCI_Column::type.
OCI_EXPORT int OCI_API OCI_ColumnGetScale | ( | OCI_Column * | col | ) |
Return the scale of the column for numeric columns.
col | - Column handle |
Definition at line 656 of file column.c.
References OCI_Column::scale.
OCI_EXPORT unsigned int OCI_API OCI_ColumnGetSize | ( | OCI_Column * | col | ) |
Return the size of the column.
col | - Column handle |
Definition at line 632 of file column.c.
References OCI_Column::charsize, OCI_Column::charused, and OCI_Column::size.
OCI_EXPORT const mtext* OCI_API OCI_ColumnGetSQLType | ( | OCI_Column * | col | ) |
Return the Oracle SQL type name of the column datatype.
col | - Column handle |
Definition at line 745 of file column.c.
References OCI_Column::csfrm, OCI_TypeInfo::name, OCI_Column::ocode, OCI_Column::prec, OCI_Column::scale, OCI_Column::subtype, and OCI_Column::typinf.
OCI_EXPORT unsigned int OCI_API OCI_ColumnGetSubType | ( | OCI_Column * | col | ) |
Return the OCILIB object subtype of a column.
col | - Column handle |
For OCI_Long type the possible values are :
For OCI_Lob type the possible values are :
For OCI_File type the possible values are :
For OCI_Timestamp type the possible values are :
For OCI_Interval type the possible values are :
Definition at line 1129 of file column.c.
References OCI_Column::subtype, and OCI_Column::type.
OCI_EXPORT unsigned int OCI_API OCI_ColumnGetType | ( | OCI_Column * | col | ) |
Return the type of the given column.
col | - Column handle |
Definition at line 601 of file column.c.
References OCI_Column::type.
OCI_EXPORT OCI_TypeInfo* OCI_API OCI_ColumnGetTypeInfo | ( | OCI_Column * | col | ) |
Return the type information object associated to the column.
col | - Column handle |
Definition at line 1116 of file column.c.
References OCI_Column::typinf.
OCI_EXPORT boolean OCI_API OCI_FetchFirst | ( | OCI_Resultset * | rs | ) |
Fetch the first row of the resultset.
rs | - Resultset handle |
Definition at line 984 of file resultset.c.
References OCI_Resultset::bof, OCI_Statement::con, OCI_Resultset::eof, OCI_Resultset::row_abs, OCI_Resultset::row_cur, and OCI_Resultset::stmt.
OCI_EXPORT boolean OCI_API OCI_FetchLast | ( | OCI_Resultset * | rs | ) |
Fetch the last row of the resultset.
rs | - Resultset handle |
Definition at line 1021 of file resultset.c.
References OCI_Resultset::bof, OCI_Statement::con, OCI_Resultset::eof, OCI_Resultset::row_abs, OCI_Resultset::row_count, OCI_Resultset::row_cur, and OCI_Resultset::stmt.
OCI_EXPORT boolean OCI_API OCI_FetchNext | ( | OCI_Resultset * | rs | ) |
Fetch the next row of the resultset.
rs | - Resultset handle |
Definition at line 907 of file resultset.c.
References OCI_Resultset::bof, OCI_Resultset::eof, OCI_Resultset::fetch_status, OCI_Statement::nb_rbinds, OCI_Resultset::row_abs, OCI_Resultset::row_count, OCI_Resultset::row_cur, OCI_Resultset::row_fetched, and OCI_Resultset::stmt.
OCI_EXPORT boolean OCI_API OCI_FetchPrev | ( | OCI_Resultset * | rs | ) |
Fetch the previous row of the resultset.
rs | - Resultset handle |
Definition at line 836 of file resultset.c.
References OCI_Resultset::bof, OCI_Statement::con, OCI_Resultset::eof, OCI_Resultset::fetch_size, OCI_Resultset::row_abs, OCI_Resultset::row_cur, OCI_Resultset::row_fetched, and OCI_Resultset::stmt.
OCI_EXPORT boolean OCI_API OCI_FetchSeek | ( | OCI_Resultset * | rs, | |
unsigned int | mode, | |||
int | offset | |||
) |
Custom Fetch of the resultset.
rs | - Resultset handle | |
mode | - Fetch direction | |
offset | - Fetch offset |
Definition at line 1060 of file resultset.c.
References OCI_Statement::con, and OCI_Resultset::stmt.
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.
rs | - Resultset handle | |
index | - Column position |
Definition at line 1273 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.
rs | - Resultset handle | |
name | - Column name |
Definition at line 1286 of file resultset.c.
References OCI_GetBigInt().
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.
rs | - Resultset handle | |
index | - Column position |
Definition at line 1828 of file resultset.c.
References OCI_Statement::con, and OCI_Resultset::stmt.
Referenced by OCI_GetColl2().
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.
rs | - Resultset handle | |
name | - Column name |
Definition at line 1848 of file resultset.c.
References OCI_GetColl().
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.
rs | - Resultset handle | |
index | - Column position |
Definition at line 1133 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.
rs | - Resultset handle | |
name | - Column name |
Definition at line 1153 of file resultset.c.
OCI_EXPORT unsigned int OCI_API OCI_GetColumnCount | ( | OCI_Resultset * | rs | ) |
Return the number of columns in the resultset.
rs | - Resultset handle |
Definition at line 1120 of file resultset.c.
References OCI_Resultset::nb_defs.
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.
rs | - Resultset handle | |
name | - Column name |
Definition at line 1172 of file resultset.c.
OCI_EXPORT unsigned int OCI_API OCI_GetCurrentRow | ( | OCI_Resultset * | rs | ) |
Retrieve the current row number.
rs | - Resultset handle |
Definition at line 1107 of file resultset.c.
References OCI_Resultset::row_abs.
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.
rs | - Resultset handle | |
index | - Column position |
Definition at line 2049 of file resultset.c.
References OCI_Resultset::row_cur.
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.
rs | - Resultset handle | |
index | - Column position |
Definition at line 1704 of file resultset.c.
References OCI_Statement::con, and OCI_Resultset::stmt.
Referenced by OCI_GetDate2(), and OCI_GetString().
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.
rs | - Resultset handle | |
name | - Column name |
Definition at line 1726 of file resultset.c.
References OCI_GetDate().
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.
rs | - Resultset handle | |
index | - Column position |
Definition at line 1682 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.
rs | - Resultset handle | |
name | - Column name |
Definition at line 1695 of file resultset.c.
References OCI_GetDouble().
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.
rs | - Resultset handle | |
index | - Column position |
Definition at line 1956 of file resultset.c.
References OCI_Statement::con, and OCI_Resultset::stmt.
Referenced by OCI_GetFile2(), and OCI_GetString().
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.
rs | - Resultset handle | |
name | - Column name |
Definition at line 1977 of file resultset.c.
References OCI_GetFile().
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.
rs | - Resultset handle | |
index | - Column position |
Definition at line 1229 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.
rs | - Resultset handle | |
name | - Column name |
Definition at line 1242 of file resultset.c.
References OCI_GetInt().
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.
rs | - Resultset handle | |
index | - Column position |
Definition at line 1766 of file resultset.c.
References OCI_Statement::con, and OCI_Resultset::stmt.
Referenced by OCI_GetInterval2(), and OCI_GetString().
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.
rs | - Resultset handle | |
name | - Column name |
Definition at line 1788 of file resultset.c.
References OCI_GetInterval().
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.
rs | - Resultset handle | |
index | - Column position |
Definition at line 1926 of file resultset.c.
References OCI_Statement::con, and OCI_Resultset::stmt.
Referenced by OCI_GetLob2(), and OCI_GetString().
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.
rs | - Resultset handle | |
name | - Column name |
Definition at line 1947 of file resultset.c.
References OCI_GetLob().
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.
rs | - Resultset handle | |
index | - Column position |
Definition at line 1986 of file resultset.c.
Referenced by OCI_GetLong2(), and OCI_GetString().
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.
rs | - Resultset handle | |
name | - Column name |
Definition at line 2005 of file resultset.c.
References OCI_GetLong().
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.
rs | - Resultset handle | |
index | - Column position |
Definition at line 1797 of file resultset.c.
References OCI_Statement::con, and OCI_Resultset::stmt.
Referenced by OCI_GetObject2().
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.
rs | - Resultset handle | |
name | - Column name |
Definition at line 1819 of file resultset.c.
References OCI_GetObject().
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.
rs | - Resultset handle | |
index | - Column position | |
buffer | - Buffer that receive the raw value | |
len | - Max size of the input buffer in bytes |
Definition at line 1635 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.
rs | - Resultset handle | |
name | - Column name | |
buffer | - Buffer that receive the raw value | |
len | - Max size of the input buffer |
Definition at line 1672 of file resultset.c.
References OCI_GetRaw().
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.
rs | - Resultset handle | |
index | - Column position |
Definition at line 1857 of file resultset.c.
References OCI_Statement::con, OCI_Resultset::stmt, and OCI_Ref::typinf.
Referenced by OCI_GetRef2(), and OCI_GetString().
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.
rs | - Resultset handle | |
name | - Column name |
Definition at line 1887 of file resultset.c.
References OCI_GetRef().
OCI_EXPORT OCI_Resultset* OCI_API OCI_GetResultset | ( | OCI_Statement * | stmt | ) |
Retrieve the resultset handle from an executed statement.
stmt | - Statement handle |
If a DML statement includes an returning clause, a resultset is implicitly created at the SQL statement execution time
Definition at line 619 of file resultset.c.
References OCI_Statement::cur_rs, OCI_Statement::fetch_size, OCI_Statement::nb_rbinds, OCI_Statement::nb_rs, OCI_Statement::rsts, and OCI_Statement::type.
OCI_EXPORT unsigned int OCI_API OCI_GetRowCount | ( | OCI_Resultset * | rs | ) |
Retrieve the number of rows fetched so far.
rs | - Resultset handle |
Definition at line 1094 of file resultset.c.
References OCI_Resultset::row_count.
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.
rs | - Resultset handle | |
index | - Column position |
Definition at line 1185 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.
rs | - Resultset handle | |
name | - Column name |
Definition at line 1198 of file resultset.c.
References OCI_GetShort().
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.
rs | - Resultset handle | |
index | - Column position |
Definition at line 1896 of file resultset.c.
References OCI_Statement::con, and OCI_Resultset::stmt.
Referenced by OCI_GetStatement2().
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.
rs | - Resultset handle | |
name | - Column name |
Definition at line 1917 of file resultset.c.
References OCI_GetStatement().
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.
rs | - Resultset handle | |
index | - Column position |
Definition at line 1317 of file resultset.c.
References OCI_Statement::con, OCI_Connection::err, OCI_DateToText(), 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_LobRead(), OCI_LobSeek(), OCI_LongGetBuffer(), OCI_RefToText(), OCI_TimestampToText(), OCI_Resultset::row_cur, and OCI_Resultset::stmt.
Referenced by OCI_GetString2().
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.
rs | - Resultset handle | |
name | - Column name |
Definition at line 1626 of file resultset.c.
References OCI_GetString().
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.
rs | - Resultset handle | |
index | - Column position |
Definition at line 1735 of file resultset.c.
References OCI_Statement::con, and OCI_Resultset::stmt.
Referenced by OCI_GetString(), 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.
rs | - Resultset handle | |
name | - Column name |
Definition at line 1757 of file resultset.c.
References OCI_GetTimestamp().
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.
rs | - Resultset handle | |
index | - Column position |
Definition at line 1295 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.
rs | - Resultset handle | |
name | - Column name |
Definition at line 1308 of file resultset.c.
References OCI_GetUnsignedBigInt().
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.
rs | - Resultset handle | |
index | - Column position |
Definition at line 1251 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.
rs | - Resultset handle | |
name | - Column name |
Definition at line 1264 of file resultset.c.
References OCI_GetUnsignedInt().
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.
rs | - Resultset handle | |
index | - Column position |
Definition at line 1207 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.
rs | - Resultset handle | |
name | - Column name |
Definition at line 1220 of file resultset.c.
References OCI_GetUnsignedShort().
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.
rs | - Resultset handle | |
index | - Column position |
Definition at line 2014 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.
rs | - Resultset handle | |
name | - Column name |
Definition at line 2027 of file resultset.c.
References OCI_IsNull().
OCI_EXPORT boolean OCI_API OCI_ReleaseResultsets | ( | OCI_Statement * | stmt | ) |
Free the statement resultsets.
stmt | - Statement handle |
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.
Definition at line 1385 of file statement.c.
References OCI_Statement::nb_rs, and OCI_Statement::rsts.
Referenced by OCI_Execute().
OCI_EXPORT OCI_Statement* OCI_API OCI_ResultsetGetStatement | ( | OCI_Resultset * | rs | ) |
Return the statement handle associated with a resultset handle.
rs | - resultset handle |
Definition at line 2036 of file resultset.c.
References OCI_Resultset::stmt.