ORAC++ Classes and Functions In this section ORAC++ classes and functions operating on member objects are described. Class Connect: This class is used to open Database connection:
|
| |
| Function | Description |
| Connect() | Default constructor |
| Connect(char *server) | Constructor - server connection |
| Connect(int mode) | Constructor - mode connection |
| Connect(int mode, char *server) | Constructor - mode, server |
| void Close() | To close connection |
| Database& OpenDatabase(char *usr, char *psw) | return Database object |
| Database* OpenADatabase(char *usr, char *psw) | return database address |
| Database& OpenDatabase(char *usr, char *psw, char *sid) | return Database - SID used |
| Database& OpenADatabase(char *usr, char *psw, char *sid) | return Database address - SID used |
|
| |
| Function | Description |
| Table& GetTable(char *name) | return Table object |
| Table* GetATable(char *name) | return Table address |
| View& GetView(char *name) | return View object |
| View* GetAView(char *name) | return View address |
| Procedure& GetProcedure(char *name) | return Procedure object |
| Function& GetFunction(char *name) | return Function object |
| Sql& GetSql() | return Sql object |
| Sql& GetSql(char *sql) | return Sql object |
| Sql* GetASql() | return Sql* object |
| Sql* GetASql(char *sql) | return Sql* object |
| void Commit() | commit changes to database |
| void Rollback() | rollback changes in database |
| void Close() | close database |
|
int GetNumColumns()
return number columns in the table
char* GetColName(int i)
return columns name (column number i)
int GetColAttr(short attr, int i)
return attribute attr for column number i
where: attr value
attr description
COLTYPE
column type
COLSIZE
column size
COLPREC
column precision
COLSCALE
column scale |
|
int GetObjType()
return object type
int GetObjLevel()
return object level
int GetObjNumColumns()
return object number columns
char* GetColName(int num)
return column name for num column
int GetColAttr(short attr, int num)
return column attribute for num column
Object& GetObject(char *name)
return nested object
RefObject* AsRef()
return RefObject from this Object |
|
| |
| Function | Description |
| RefObject(const Table& t) | constructor based on Table |
| RefObject(const Object* o) | constructor based on Object |
| OCIRef* GetRef() | return OCI reference to object |
|
| |
| Function | Description |
| Select(Table& t) | class constructor - based on Table |
| Select(Table* t) | class constructor - based on Table* |
| Select(View& t) | class constructor - based onView |
| Select(View* t) | class constructor - based onView* |
| Select(Object& t) | class constructor - based on Object |
| Select(Object* t) | class constructor - based on Object* |
| int Row() | fetch rows, return number rows fetched |
| void Array(int num) | set number of rows to be fetched by Row() |
| void ClearColumns() | reset selected columns |
| void ClearWhere() | remove query condition |
| void Reset() | reset selected and query columns |
| void AsRecord() | set pre-formatted record display |
| void AsLine() | set pre-formatted line display |
| char* In(char* data) - external function | process 'in(...)' statement |
| char* NotIn(char* data) - external function | process 'not in(...)' statement |
| char* In(Select& s) - external function | process sub-query |
| char* NotIn(Select& s) - external function | process sub-query |
| char* Exists(Table& t) | process 'exists' sql statement |
| char* NotExists(Table& t) | process 'not exists' sql statement |
| void Prepare() | prepare and parse SQL statement |
| Select& operator+=(Table& t) | add Table object to Select |
| Select& operator+=(View& t) | add View object to Select |
| Select& operator+=(Object& t) | add Object object to Select |
| Select& operator<<(int& i) | load fetched data into integer variable |
| Select& operator<<(double& i) | load fetched data into double variable |
| Select& operator<<(char* i) | load fetched data into char* variable |
| Select& operator<<(TInt& i) | load fetched data into TInt object |
| Select& operator<<(TFloat& i) | load fetched data into TFloat object |
| Select& operator<<(TStr& i) | load fetched data into TStr object |
| Select& operator<<(TDate& i) | load fetched data into TDate object |
| Select& operator<<(TRowid& i) | load fetched data into TRowid object |
| Select& operator<<(TClob& i) | load fetched data into TClob object |
| Select& operator<<(TBlob& i) | load fetched data into TBlob object |
| Select& operator<<(Aggregate& i) | load fetched data into Aggregate object |
| Select& operator<<(Record& i | load fetched data into Record object |
| Select& operator<<(Line& i) | load fetched data into Line object |
| Select& operator<<(int[] i) | load fetched data into array of integers |
| Select& operator<<(double[] i) | load fetched data into array of doubles |
| Select& operator<<(char *i[]) | load feched data into array of char* |
| Select& operator<<(TInt[] i) | load fetched data into array of TInt |
| Select& operator<<(TFloat[] i) | load fetched data into array of TFloat |
| Select& operator<<(TStr[] i) | load fetched data into array of TStr |
| Select& operator>>(const int& i) | set query data |
| Select& operator>>(const double& i) | set query data |
| Select& operator>>(const char* i) | set query data |
| Select& operator>>(const TRowid& i) | set query data |
| Select& operator>>(const TDate& i) | set query data |
|
| |
| Function | Description |
| Insert (Table& t) | class constructor |
| int Row() | insert and return number of rows inserted |
| void Array(int n) | set batch insert array size ( nrows ) |
| void Prepare() | prepare and parse SQL statement |
| Insert& operator>>(const int& i) | insert integer data |
| Insert& operator>>(const double& i) | insert double data |
| Insert& operator>>(const char* i) | insert char* data |
| Insert& operator>>(const TDate& i) | insert TDate data |
| Insert& operator>>(const TClob& i) | insert TClob data |
| Insert& operator>>(const TBlob& i) | insert TBlob data |
| Insert& operator>>(const TInt& i) | insert TInt data |
| Insert& operator>>(const TFloat& i) | insert TFloat data |
| Insert& operator>>(const TStr& i) | insert TStr data |
| Insert& operator>>(const int i[] ) | insert array of integers |
| Insert& operator>>(const double i[] ) | insert array of doubles |
| Insert& operator>>(char *i[]) | insert array of char* |
| Insert& operator>>(const TInt i[]) | insert array of TInt |
| Insert& operator>>(const TFloat i[]) | insert array of TFloat |
| Insert& operator>>(const TStr i[]) | insert array of TStr |
|
| |
| Function | Description |
| Update (Table& t) | class constructor (based on class Table) |
| int Row() | insert a row(s) into the table |
| void Data() | reset update and where columns |
| void ClearWhere() | remove query condition |
| void Prepare() | prepare and parse SQL statement |
| int GetLobs() | get all LOB columns (if LOB update) |
| Update& operator>>(const int& i) | set update data |
| Update& operator>>(const double& i) | set update data |
| Update& operator>>(const char* i) | set update data |
| Update& operator>>(const TInt& i) | set update data |
| Update& operator>>(const TFloat& i) | set update data |
| Update& operator>>(const TStr& i) | set update data |
| Update& operator>>(const TDate& i) | set update data |
| Update& operator>>(const TClob& i) | set update data |
| Update& operator>>(const TBlob& i) | set update data |
|
| |
| Function | Description |
| Delete (Table& t) | class constructor (based on class Table) |
| int Row() | delete row(s) from a table - return number rows deleted |
| void ClearWhere() | reset query condition |
| void Prepare() | prepare and parse SQL statement |
|
|
|
| |
| Function | Description |
| void Execute() | execute Stored Function |
| void Array(int n) | set array processing to nrows |
| void Prepare() | prepare and parse sql statement |