Database API Reference
AdvantageBuilder provides a unified set of database helper functions that can be used from JScript.NET, ClearScript V8, and PowerShell macros and templates. These APIs let you execute commands, retrieve datasets, and work with XML representations of data using the current connection or an explicit connection string.
Supported Runtimes
The database APIs are available from:
- JScript.NET (SetupJS runtime)
- ClearScript V8 (SetupJS runtime)
- PowerShell (SetupPS runtime)
ExecuteNonQuery
Executes a non‑query command (INSERT, UPDATE, DELETE, DDL) and returns the number of affected rows.
ExecuteNonQuery(cmd)– uses the current connectionExecuteNonQuery(cmd, connType, connString)– uses an explicit connection type and string
ExecuteDataset
Executes a query and returns a dataset object.
ExecuteDataset(cmd)– uses the current connectionExecuteDataset(cmd, connType, connString)– uses an explicit connection type and string
ExecuteDatasetXML
Executes a query and returns an XML representation of the dataset.
ExecuteDatasetXML(cmd)– uses the current connectionExecuteDatasetXML(cmd, connType, connString)– uses an explicit connection type and string
ExecuteBatchTran
Executes multiple statements in a single transaction (INSERT, UPDATE, DELETE, DDL) and returns the number of affected rows.
ExecuteBatchTran(commands)– uses the current connectionExecuteBatchTran(commands, connType, connString)– uses an explicit connection type and string
DataRow Helpers (JavaScript)
Additional helper available from the JavaScript runtimes:
setDataRowValue(row, col, val)
Creating Datasets
You can create an empty dataset object and populate it programmatically:
createDataSet()– available from both JavaScript and PowerShell runtimes