Database Access functions | |
These functions are used in context of database access | |
void | fwConfigurationDB_openDBConnection (string dbConnectionName, dbConnection &dbCon, dyn_string &exceptionInfo) |
void | _fwConfigurationDB_executeSqlFromFile (dbConnection dbCon, string fileName, string whatItIs, dyn_string &exceptionInfo, bool breakOnDbError=TRUE) |
string | _fwConfigurationDB_checkSchemaPrivileges (dbConnection dbCon, dyn_string &exceptionInfo) |
void | fwConfigurationDB_checkOpenDB (dyn_string &exceptionInfo) |
void | fwConfigurationDB_initializeQuery (string sql, dbConnection conn, dbCommand &dbCmd, dyn_string &exceptionInfo) |
void | fwConfigurationDB_initializeQueryWithParams (string sql, dbConnection conn, mixed bindParams, dbCommand &dbCmd, dyn_string &exceptionInfo) |
int | fwConfigurationDB_fetchQuery (dbCommand &dbCmd, dyn_dyn_mixed &aRecords, dyn_string &exceptionInfo, int maxRecords=0, bool columnWise=FALSE, bool closeOnNoMoreData=TRUE, dyn_int colTypes=0, int numCol=999) |
void | _fwConfigurationDB_executeDBQuery (string sql, dbConnection conn, dyn_dyn_mixed &aRecords, dyn_string &exceptionInfo, int numCol=999, bool columnWise=FALSE, dyn_int colTypes=0) |
void | _fwConfigurationDB_executeDBQueryWithParams (string sql, dbConnection conn, anytype bindParams, dyn_dyn_mixed &aRecords, dyn_string &exceptionInfo, int numCol=999, bool columnWise=FALSE, dyn_int colTypes=0) |
void | _fwConfigurationDB_executeDBBulkCmd (string sql, dbConnection conn, dyn_dyn_mixed data, dyn_string &exceptionInfo, bool columnWise=FALSE) |
void | _fwConfigurationDB_executeDBCmd (string sql, dbConnection conn, anytype params, dyn_string &exceptionInfo) |
void | fwConfigurationDB_executeSqlSimple (string sql, dbConnection connection, dyn_string &exceptionInfo) |
bool | _fwConfigurationDB_hasKeywords (string src, string keywords) |
void fwConfigurationDB_openDBConnection | ( | string | dbConnectionName, | |
dbConnection & | dbCon, | |||
dyn_string & | exceptionInfo | |||
) |
opens connection to the database
exceptionInfo | standard exception handling variable |
Returned error codes:
void _fwConfigurationDB_executeSqlFromFile | ( | dbConnection | dbCon, | |
string | fileName, | |||
string | whatItIs, | |||
dyn_string & | exceptionInfo, | |||
bool | breakOnDbError = TRUE | |||
) |
executes SQL statements stored in a file
Note that the all commands in the file should be terminated by the semicolon (;) character, which should be the last characted in the line. The comments (lines starting with "-" character) and white-spaces are a also automatically removed.
dbCon | database connection descriptor | |
filename | the name of the file, where the SQL statements are stored. The file needs to be in the "config" directory of the project. | |
whatItIs | a short text describing the context in which the statements are executed. Used only for printouts. | |
exceptionInfo | standard exception handling variable | |
breakOnDbError | (optional, default is TRUE) determines if the function should return terminate with an exception upon first encountered error, or it should rather try to finish the remaining commands (the errors encountered in a meantime will be reported at the end). |
string _fwConfigurationDB_checkSchemaPrivileges | ( | dbConnection | dbCon, | |
dyn_string & | exceptionInfo | |||
) |
void fwConfigurationDB_checkOpenDB | ( | dyn_string & | exceptionInfo | ) |
void fwConfigurationDB_initializeQuery | ( | string | sql, | |
dbConnection | conn, | |||
dbCommand & | dbCmd, | |||
dyn_string & | exceptionInfo | |||
) |
void fwConfigurationDB_initializeQueryWithParams | ( | string | sql, | |
dbConnection | conn, | |||
mixed | bindParams, | |||
dbCommand & | dbCmd, | |||
dyn_string & | exceptionInfo | |||
) |
int fwConfigurationDB_fetchQuery | ( | dbCommand & | dbCmd, | |
dyn_dyn_mixed & | aRecords, | |||
dyn_string & | exceptionInfo, | |||
int | maxRecords = 0 , |
|||
bool | columnWise = FALSE , |
|||
bool | closeOnNoMoreData = TRUE , |
|||
dyn_int | colTypes = 0 , |
|||
int | numCol = 999 | |||
) |
Fetches the data from the already-executed (initialized) db query, according to specification.
closeOnNoMoreData | - if all data from the query is fetched, it will finalize the dbCommand (so you do not need to do it yourself) |
void _fwConfigurationDB_executeDBQuery | ( | string | sql, | |
dbConnection | conn, | |||
dyn_dyn_mixed & | aRecords, | |||
dyn_string & | exceptionInfo, | |||
int | numCol = 999 , |
|||
bool | columnWise = FALSE , |
|||
dyn_int | colTypes = 0 | |||
) |
void _fwConfigurationDB_executeDBQueryWithParams | ( | string | sql, | |
dbConnection | conn, | |||
anytype | bindParams, | |||
dyn_dyn_mixed & | aRecords, | |||
dyn_string & | exceptionInfo, | |||
int | numCol = 999 , |
|||
bool | columnWise = FALSE , |
|||
dyn_int | colTypes = 0 | |||
) |
void _fwConfigurationDB_executeDBBulkCmd | ( | string | sql, | |
dbConnection | conn, | |||
dyn_dyn_mixed | data, | |||
dyn_string & | exceptionInfo, | |||
bool | columnWise = FALSE | |||
) |
void _fwConfigurationDB_executeDBCmd | ( | string | sql, | |
dbConnection | conn, | |||
anytype | params, | |||
dyn_string & | exceptionInfo | |||
) |
void fwConfigurationDB_executeSqlSimple | ( | string | sql, | |
dbConnection | connection, | |||
dyn_string & | exceptionInfo | |||
) |
bool _fwConfigurationDB_hasKeywords | ( | string | src, | |
string | keywords | |||
) |
Checks if all specified keywords are present in the string
if ALL the keywords are found, the funtion returns TRUE