Testing with Bqurious > Actions
Database
Database actions help you to perform various queries on the database.
IMPORTANT
A database connection needs to be created under DB Connect (Configure > DB Connect) and the created variable can then be used in the Database String parameter for various database keywords.
Database Connection String format : Type | Name / IP Address : Port | SID | Database Name | User Name | Password
The database types available in BQ Platform are :
- Oracle
- MySQL
- SQL Server
- Postgres
To know how to establish a connection with the Database, please go through the DB Connect document.
Structure :
executeUpdateQuery <parameters>
| Action | Parameter | Example Usage |
|---|---|---|
executeQueryAndStoreResults Web, Mobile --- To execute the query (mentioned in Parameter 2) on database, with database connection string (mentioned in Parameter 1) and store the result in variable (mentioned in Parameter 3) for further use. | Param 1 : Database connection string Param 2 : Query to execute Param 3 : Variable name to store theresultant value | Example : Suppose the DB Connect variable created is bqdbString with values *MySQL |
executeUpdateQuery Web, Mobile --- To execute the update query (mentioned in Parameter 2) on database, with database connection string (mentioned in Parameter 1). | Param 1 : Database Connection String Param 2 : Update Query to execute | Example : Suppose the DB Connectvariable created is bqdbString with values *MySQL |
executeDeleteQuery Web, Mobile --- To execute the delete query (mentioned in Parameter 2) on database, with database connection string (mentioned in Parameter 1). | Param 1 : Database Connection String Param 2 : Delete Query to execute | Example : Suppose the DB Connectvariable created is bqdbString with values *MySQL |
executeInsertQuery Web, Mobile --- To execute the insert query (mentioned in Parameter 2) on database, with database connection string (mentioned in Parameter 1). | Param 1 : Database Connection String Param 2 : Insert Query to execute | Example : Suppose the DB Connectvariable created is bqdbString with values *MySQL |
executeStoredProcedureAndStoreResult Web, Mobile --- To execute the stored procedure (mentioned in Parameter 2) on database, with database connection string (mentioned in Parameter 1). | Param 1 : Database Connection String Param 2 : Name of procedure | Example : Suppose the DB Connectvariable created is bqdbString with values *MySQL |
setDbInputParameter Web, Mobile --- To set the input parameter name (mentioned in parameter 1) and parameter value (mentioned in parameter 2), of data type (mentioned in parameter 3). > [!NOTE] The default parameter type is String. If no value is provided in param 3, String will be used as parameter type. If parameter type is mentioned as Date, default date format will be used unless user provides a date format in param 4. | Param 1 : Name of the parameter Param 2 : Value of the parameter Param 3 (Optional) : Type of parameter Param 4 (Optional) : Data Format | Example 1 : setDbInputParameter : <Parameter Name : userName> <Parameter Value : bqurious> <Parameter Type : > <Date Format : > Sets input parameter name userName with parameter value bqurious of parameter type String. Example 2 : setDbInputParameter : <Parameter Name : setDate> <Parameter Value : 16/04/2020> <Parameter Type : Date> <Date Format : > Suppose the default date format mentioned in App config. is MM/dd/yy. Sets input parameter name setDate with parameter value 04/16/20 (date converted to default format) of parameter type Date. Example 3 : setDbInputParameter : <Parameter Name : setDate> <Parameter Value : 16/04/2020> <Parameter Type : Date> <Date Format : dd/MM/yy> Sets input parameter name setDate with parameter value 16/04/20 (date converted to the provided format in param 4) of parameter type Date. |
setDbOutputParameter Web, Mobile --- To set the output parameter (name mentioned in parameter 1) of data type (type mentioned in Parameter 3. > [!NOTE] The default parameter type is String. If no value is provided in param 2, String will be used as parameter type. | Param 1 : Name of the parameter Param 2 (Optional) : Type of parameter | Example 1 : setDbOutputParameter : <Parameter Name : userName> <Parameter Type : > Sets output parameter userName of type String. Example 2 : setDbOutputParameter : <Parameter Name : setDate> <Parameter Type : Date> Sets output parameter setDate of type Date. |
verifyQueryResults Web, Mobile --- To verify the query (mentioned in Parameter 2) on database, with database connection string (mentioned in Parameter 1), returns the value (mentioned in Parameter 3). | Param 1 : Database connection string Param 2 : Query to execute Param 3 : Expected Result | Example : Suppose the DB Connectvariable created is bqdbString with values *MySQL |
