Collaboration diagram for OCICPP::Cursor:
Public Methods | |
Cursor () | |
Cursor (OCIEnv *,OCISvcCtx *,OCIError *er, int prefetch, int Type=DEFAULT) | |
void | init (OCIEnv *,OCISvcCtx *,OCIError *er, int prefetch, int Type=DEFAULT) |
~Cursor () | |
void | drop () |
void | setPrefetch (unsigned nRows) |
int | prepare (const string &) |
void | exec () |
void | describe () |
void | define () |
void | hashHead () |
void | execute (int prefetch=1) |
void | bind (const string &par, char *buf, int buflen, short *isNull=0) |
void | bind (const string &par, const string &val, short *isNull=0) |
void | bind (const string &par, int &val, short *isNull=0) |
void | bind (const string &par, double &val, short *isNull=0) |
void | bind (const string &par, RowID &val, short *isNull=0) |
void | bind (const string &par, Cursor &val, short *isNull=0) |
void | bind (const string &par, Lob &val, short *isNull=0) |
bool | fetch () |
void | getStr (int col, string &,bool *isNull=0) const |
void | getInt (int col, int &val, bool *isNull=0, const int *null_value=0) const |
void | getDouble (int col, double &val, bool *isNull=0, const double *null_value=0) const |
void | getStrMon (int col, string &val) const |
void | getSec (int col, int &val) const |
void | getMin (int col, int &val) const |
void | getHour (int col, int &val) const |
void | getDay (int col, int &val) const |
void | getMonth (int col, int &val) const |
void | getYear (int col, int &val) const |
void | getCLOB (int col, Lob &) const |
void | getBLOB (int col, Lob &) const |
void | getFILE (int col, BFile &) const |
void | getRowID (int col, RowID &) const |
void | getCursor (int col, Cursor &) const |
string | getStr (int col, bool *isNull=0) const |
int | getInt (int col, bool *isNull=0, const int *null_value=0) const |
double | getDouble (int col, bool *isNull=0, const double *null_value=0) const |
void | getStr (const string &col, string &val, bool *isNull=0) const |
void | getInt (const string &col, int &val, bool *isNull=0, const int *null_value=0) const |
void | getDouble (const string &col, double &val, bool *isNull=0, const double *null_value=0) const |
void | getStrMon (const string &,string &) const |
void | getSec (const string &,int &) const |
void | getMin (const string &,int &) const |
void | getHour (const string &,int &) const |
void | getDay (const string &,int &) const |
void | getMonth (const string &,int &) const |
int | getDay (int col) const |
int | getMonth (int col) const |
int | getYear (int col) const |
int | getHour (int col) const |
int | getSec (int col) const |
int | getMin (int col) const |
int | getDay (const string &col) const |
int | getMonth (const string &col) const |
int | getYear (const string &col) const |
int | getHour (const string &col) const |
int | getSec (const string &col) const |
int | getMin (const string &col) const |
void | getYear (const string &,int &) const |
void | getCLOB (const string &col, Lob &lob) const |
void | getBLOB (const string &col, Lob &lob) const |
void | getFILE (const string &col, BFile &bfile) const |
void | getRowID (const string &col, RowID &rid) const |
void | getCursor (const string &col, Cursor &cur) const |
string | getStr (const string &col, bool *isNull=0) const |
int | getInt (const string &col, bool *isNull=0, const int *null_value=0) const |
double | getDouble (const string &col, bool *isNull=0, const double *null_value=0) const |
int | getNCols () const |
void | getColName (int col, string &) const |
int | getColSize (int col) const |
int | getColSize (const string &) const |
int | getColType (int col) const |
int | getColType (const string &) const |
void | getColTypeName (int col, string &) const |
void | getColTypeName (const string &,string &) const |
bool | isNull (int col) const |
bool | isNull (const string &) const |
void | setNullText (const string &) |
This class represents a database cursor, which is used to access a set or list of database rows from a single entity or a join of multiple entities.
A cursor may be generate by issuing for example a 'SELECT'-statement, e.g.
SELECT OWNER,CONSTRAINT_NAME,CONSTRAINT_TYPE,TABLE_NAME FROM USER_CONSTRAINTS
An brief example:
Connection con; Connection::connect( tnsname, user, password, con); Cursor *csr = con.execQuery("SELECT OWNER,CONSTRAINT_NAME,CONSTRAINT_TYPE,TABLE_NAME FROM USER_CONSTRAINTS"); while ( csr->fetch() ) { cout << csr->getStr( 0 ) << "." << csr->getStr( "CONSTRAINT_NAME" ) << endl; }
In this example, a cursor is being generated, that can be used to retreive the four columns OWNER
, CONSTRAINT_NAME
, CONSTRAINT_TYPE
, TABLE_NAME
from the USER_CONSTRAINTS
table. The columns of this cursor may be accessed either by their ordering ( from left to right starting with index 0
) or by using their column name to index them (be sure to use capital letters when accessing them )
|
Default Constructor: Create a cursor variable, which is not bound to any query (yet). A cursor create in such a manner can for example be used for Connection::execQuery(const string &,Cursor &,int) |
|
Destructor |
|
Clear the content of the cursor. This function may be used to free a cursor variable before reusing it again. |
|
Fetch the content of the cursor's next row(s) from the database server
|
|
Initializes lob with the content of the binary large object (BLOB) from the column named colName from the cursor's current position.
|
|
Initializes lob with the content of the binary large object (BLOB) in column col from the cursor's current position.
|
|
Initializes lob with the content of the character large object (CLOB) from the column named colName from the cursor's current position.
|
|
Initializes lob with the content of the character large object (CLOB) in column col from the cursor's current position.
|
|
Retreive the name of column col into ret_col . |
|
Retrieve the size for the cursor's column named colName .
|
|
Retrieve the size for the cursor's column indexed by col . The interpretation of the returned figure depends on the type of the column. For example, if a column of type
|
|
Returns the internal Oracle type for column named colName . col is counted starting from 0 for the first column selected within the current cursor.
The possible return value may be
|
|
Returns the internal Oracle type for column col . col is counted starting from 0 for the first column selected within the current cursor.
The possible return value may be
|
|
Store the description of the type of the data stored in column named colName into typeName .
|
|
Store the description of the type of the data stored in column index by col into typeName .
|
|
If used for a Date-Column named colName, this function returns the day (day of month) from this date.
|
|
If used for a Date-Column col, this function returns the day (day of month) from this date.
|
|
If used for a Date-Column named colName, this function reads the day (day of month) from this date.
|
|
If used for a Date-Column col, this function reads the day (day of month) from this date.
|
|
Return a double value from the column named col . Unless pointing to 0, *isNull set to
|
|
Read a double value val from the column named colName . Unless pointing to 0, *isNull set to
|
|
Return a double value from the column indexed by col . Unless pointing to 0, *isNull set to
|
|
Read a double value val from the column indexed by col . Unless pointing to 0, *isNull is set to
|
|
Initializes bfile with the content of an external binary large object (BFILE) from the column named colName from the cursor's current position.
|
|
Initializes bfile with the content of an external binary large object (BFILE) from the column col from the cursor's current position.
|
|
If used for a Date-Column col, this function returns the hours stored within this date.
|
|
If used for a Date-Column col, this function returns the hours stored within this date.
|
|
If used for a Date-Column col, this function reads the hours hour stored within this date.
|
|
If used for a Date-Column col, this function reads the hours hour stored within this date.
|
|
Return an integer value from the column named col . Unless pointing to 0, *isNull is set to
|
|
Read an integer value val from the column named colName . Unless pointing to 0, *isNull is set to
|
|
Return an integer value from the column indexed by col . Unless pointing to 0, *isNull is set to
|
|
Read an integer value val from the column indexed by col . Unless pointing to 0, *isNull is set to
|
|
If used for a Date-Column named colName, this function returns the minutes stored within this date.
|
|
If used for a Date-Column col, this function returns the minutes stored within this date.
|
|
If used for a Date-Column named colName, this function reads the minutes min stored within this date.
|
|
If used for a Date-Column col, this function reads the minutes min stored within this date.
|
|
If used for a Date-Column named colName, this function returns the month (month of the year) from this date.
|
|
If used for a Date-Column col, this function returns the month (month of the year) from this date.
|
|
If used for a Date-Column named colName, this function reads the month val (month of the year) from this date.
|
|
If used for a Date-Column col, this function reads the month mon (month of the year) from this date.
|
|
Returns the number of columns within this cursor. |
|
If used for a Date-Column named colName, this function returns the seconds stored within this date.
|
|
If used for a Date-Column col, this function returns the seconds stored within this date.
|
|
If used for a Date-Column named colName, this function reads the seconds val stored within this date.
|
|
If used for a Date-Column col, this function reads the seconds sec stored within this date.
|
|
Convenience function to retreive a string value from the cursor's current position put of column named colName . If isNull is not pointing to 0, *isNull is set to
|
|
Retrieve a string value val from the column named colName out of the current cursor position. If isNull is not pointing to 0, it is set according to the returned value.
|
|
Convenience function to retreive a string value from the cursor's current position put of column col . If isNull is not pointing to 0, *isNull is set to
|
|
Retrieve content from column number col into the string str. If isNull is not pointing to 0, this boolean reflects, if the cell's content was NULL or not.
|
|
Reads the month from a date column named colName and returns the value as mon . mon will be one of the following:
|
|
Reads the month from a date column col and returns the value as mon . mon will be one of the following:
|
|
If used for a Date-Column named colName, this function returns the year from this date.
|
|
If used for a Date-Column named colName, this function returns the year from this date.
|
|
If used for a Date-Column col, this function reads the year from this date.
|
|
If used for a Date-Column col, this function reads the year from this date.
|
|
Returns
|
|
Returns
|
|
Set's text which will be returned on request of null cell default "" (empty text) |