use database
Specify a database against which the ensuing SQL action lines are to be applied.
Name | Description | Type | Modifier |
---|---|---|---|
name | Name of the database connection (previously established via the connect database action). | String | None |
None
The following example illustrates the process of connecting to, and using a database from within a test. After creating a named connection string and using it to connect to the database, invoke use database to specify the active database to be used by the test.
variable driver host create connection string Northwind_conn_strg SQL Server lgdn15031-w7d01 port database name username >>> Northwind password others >>> Trusted_Connection=Yes connection string name connect database #Northwind_conn_strg Northwind_conn name use database Northwind_conn command result execute sql select ContactName from Customers where CustomerID='ABOUT' contactname_ds

- This action is generally invoked as part of a sequence of actions to allow the test to access a data source. (See Testing with databases for more information)
- This action supports the <ignore> modifier. If the string
<ignore>
is present as the value of the argument, or the argument contains an expression that evaluates to<ignore>
, the action is skipped during execution.