Database Access Functions

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)

Function Documentation

void fwConfigurationDB_openDBConnection ( string  dbConnectionName,
dbConnection &  dbCon,
dyn_string &  exceptionInfo 
)

opens connection to the database

Parameters:
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.

Parameters:
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.

Parameters:
closeOnNoMoreData - if all data from the query is fetched, it will finalize the dbCommand (so you do not need to do it yourself)
Returns:
0 if there is no more data to fecth
1 if there is still data to fetch
-1 in case of an error
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

  • used for parsing of SQL file note that the keywords should be comma or space separated

if ALL the keywords are found, the funtion returns TRUE


Generated on 4 Oct 2012 for Configuration Database component by  doxygen 1.6.1