Native
Synchronous
No Custom Parameters
OpenDatabase creates a named connection to a specific database instance which can then be subsequently used by the rest of the script instance.
OpenDatabase creates a connection with a name of your choosing, and associates that connection with your script instance. Subsequent Database API actions, such as ExecuteScalar, ExecuteQuery, and ExecuteCommand reference this connection by the same Name supplied in OpenDatabase.
The underlying mechanism for communicating with the database is based on ADO.NET. Subsequently, the benefits of .NET connection pooling are inherent to the Database API methods. To maximize scalability of the connection pool, the OpenDatabase action does not keep the connection open. The connection is created, opened, and closed in rapid succession. By performing these set of operations, the OpenDatabase action will fail with Failure if there is a connectivity issue (i.e., if the database is down or if the connection string is wrong). However, if the connection is created and connected successfully, the newly-created database connection is put back into the pool.
There is no need to use OpenDatabase for databases defined in the Cisco Unified Application Designer as a script resource. In that case, the name of the database connection is the name of the database resource as defined in the Cisco Unified Application Designer.
When the script instance is destroyed, the connection created by the OpenDatabase action is disposed automatically.
| Parameter Name | .NET Type | Default | Description |
|---|---|---|---|
| DSN * | System.String | An ADO.NET connection string formatted appropriately for the Type of database being connected to. You can use the FormatDSN action to help format this string. | |
| Name * | System.String | A name for this connection. This name must be used in all subsequent Database API methods in this script instance. | |
| Type * | Metreos.Utilities.Database+DbType | oracle | The type of database to connect to. The following are the possible values:
|
No Result Data
Branch Conditions
No description.
No description.