This keyword library provides Driver Database Commands that can be used by all three DDE Drivers--CycleDriver, SuiteDriver, and StepDriver. That means they can be used in any keyword driven test tables regardless of the test tables level--Cycle, Suite, or Step.
Each different driver command has different parameters as described in its documentation. For reference, the first fields of ALL Driver Command test records are defined below:
Most all commands here require a data source name, Since this driver
uses jdbc, then a format like "jdbc:odbc:drivername" is
usually supplied for that parameter. Another examples could
be: jdbc:oracle:thin:@machine:1111:DBNAME
If the jdbc:odbc: is omitted, then the 'drivername' is
assumed to be Sun's jdbc-odbc bridge
(sun.jdbc.odbc.JdbcOdbcDriver) and that string (jdbc:odbc:)
is automatically prepended.
Notice that for all of the commands here which accept the ADBAlias and ATableAlias parameters, that they are not used. They are only there because there for compatibility with the Component Function versions of these commands (CFDatabase).
In order to specify the driver, a 'setJdbcDriver' command can be used once at the beginning
Examples:
C, setJdbcDriver, "sun.jdbc.odbc.JdbcOdbcDriver"
C, setJdbcDriver, "oracle.jdbc.driver.OracleDriver"
Driver Command parameters must be placed in the test record in the field position specified in the documentation. Some parameters are optional and can be skipped. Optional parameters can only be skipped if all subsequent optional paramaters are also skipped.
Example:
c, deleteDBTableRecords, ADBAlias, ATableAlias, DBTableName, DBQueryCond, DBSourceName
The above example skips the UserId, Password, and SQLStatus (they are not even included)
CopyDBTableColumnToFile |
|
This routine will copy the contents of one or more DBTable column(s) to a file. | |||
CopyDBTableToFile |
|
This routine will copy the contents of a DBTable to a file. | |||
DeleteDBTableRecords |
|
Deletes records in a database table | |||
ExecSQLQuery |
|
Executes the query provided in a queryStr on the database table. | |||
GetDBTableColumnCount |
|
Executes the query in a specified database table and returns the total column count. | |||
GetDBTableRowCount |
|
Executes the query in a database table. | |||
GetDBValue |
|
Executes the query and returns the case-sensitive value as result of the execution. | |||
SetJdbcDriver |
|
set Jdbc Driver | |||
VerifyDatabaseNullValue |
|
Verifies the value of a field in a database table is NULL | |||
VerifyDatabaseValue |
|
Verifies the case-sensitive value of a field in a database table | |||
VerifyDBNullValue |
|
Verifies the value of a field in a database table is NULL | |||
VerifyDBValue |
|
Verifies the case-sensitive value of a field in a database table |
RJ | TID | SDC |
A data source name and Query String is required. You also have to specify a variable to get the status code. And optionally user id and password (this is because some drivers don't need a user/password).
RJ | TID | SDC |
A data source name and Query String is required. You also have to specify a variable to get the status code. And optionally user id and password (this is because some drivers don't need a user/password).
OPTIONAL parameter. If specified the output file will contain only the number of columns specified. This number will become the first dimension of the retreival array. If NOT specified then no maximum.
OPTIONAL parameter. If specified the output file will contain only the number of columns specified. This number will become the first dimension of the retreival array. If NOT specified then no maximum.
RJ | TID | SDC |
A table name is required. You also have to specify data source name, and optionally user id and password (this is because some drivers don't need a user/password).
A query condition can be included. It can be any
valid expression allowed by the WHERE clause of the DELETE FROM sentence of the SQL driver
you are using. For example: "CliBal > 100000 and CliCat = 'C'".
Including "where" in the expression itself is optional. It will
be prefixed to the expression if it is not provided.
RJ | TID | SDC |
A data source name and Query String is required. You also have to specify a variable to get the status code. And optionally user id and password (this is because some drivers don't need a user/password).
Use this command with caution. It doesn't return any value back other than the SQL Status code. So, remember not to use 'SELECT' command inside the queryStr. It should rather be used to do an 'UPDATE', 'INSERT' or 'DELETE'.
RJ | TID | SDC |
A data source name and Table name are required. You also have to specify a variable to get the result of the SQL and status code. And optionally user id and password (this is because some drivers don't need a user/password).
RJ | TID | SDC |
A data source name and Query String is required. You also have to specify a variable to get the status code. And optionally user id and password (this is because some drivers don't need a user/password).
RJ | TID | SDC |
To return the value, it executes a SQL query sentence using a data source to connect to the data base (using a 'SELECT').
A queryStr and the two return variables to store the query result and SQL Status code are required. You also have to specify data source name and optionally user id and password (this is because some drivers don't need a user/password).
If the query returns more than one record, the returned value is the corresponding to the first one, unless the field name be something like COUNT(*) or SUM(InvoiceTot).
RJ | TID | SDC |
RJ | TID | SDC |
Sometimes you have to check if a field's value is NULL. This NULL value is different from any other (even zero for numerics and null string for characters), so if you try to check it using VerifyDBValue() function, if will fail.
A table and field name are required. You also have to specify data source name, user id and password (the user id and password can be "" meaning not required).
A query condition can be included. It can be any
valid expression allowed by the WHERE clause of the SELECT sentence of the SQL driver
you are using. For example: "CliBal > 100000 and CliCat = 'C'".
Including "where" in the expression itself is optional. It will
be prefixed to the expression if it is not provided.
RJ | TID | SDC |
To return the value, it executes a SQL query sentence using a data source to connect to the data base (using a 'SELECT').
A table and field name are required. You also have to specify data source name, user id, password, and the expected value.
If the query returns more than one record, the returned value is the corresponding to the first one, unless the field name be something like COUNT(*) or SUM(InvoiceTot).
A query condition can be included. It can be any
valid expression allowed by the WHERE clause of the SELECT sentence of the SQL driver
you are using. For example: "CliBal > 100000 and CliCat = 'C'".
Including "where" in the expression itself is optional. It will
be prefixed to the expression if it is not provided.
RJ | TID | SDC |
Sometimes you have to check if a field's value is NULL. This NULL value is different from any other (even zero for numerics and null string for characters), so if you try to check it using VerifyDBValue() function, if will fail.
A table and field name are required. You also have to specify data source name, user id and password (the user id and password can be "" meaning not required).
A query condition can be included. It can be any
valid expression allowed by the WHERE clause of the SELECT sentence of the SQL driver
you are using. For example: "CliBal > 100000 and CliCat = 'C'".
Including "where" in the expression itself is optional. It will
be prefixed to the expression if it is not provided.
RJ | TID | SDC |
To return the value, it executes a SQL query sentence using a data source to connect to the data base (using a 'SELECT').
A table and field name are required. You also have to specify data source name, user id, password, and the expected value.
If the query returns more than one record, the returned value is the corresponding to the first one, unless the field name be something like COUNT(*) or SUM(InvoiceTot).
A query condition can be included. It can be any
valid expression allowed by the WHERE clause of the SELECT sentence of the SQL driver
you are using. For example: "CliBal > 100000 and CliCat = 'C'".
Including "where" in the expression itself is optional. It will
be prefixed to the expression if it is not provided.