AppDB ReadIntegerPairsWithSQL() Method

(SBM On-Premise/PaaS only) Reads multiple rows of two integer columns from the database, filling the Vector "out" with Pair<int,int> values.

Function Signature

 bool ReadIntegerPairsWithSQL( sqlText, Vector& out, [, Vector params] )

Parameters

Parameter Type Description

sqlText

string

The SQL to invoke.

out

Vector&

The results of the query. Each entry in the Vector will be a Pair of int values.

params

Vector

An optional Vector storing SQL bind parameters, where each entry is a Pair, with the first value as the parameter type and the second value as the value to bind to the SQL parameter. Corresponds to DBTypeConstants.

Return

Type Description

bool

Returns true if successful; false otherwise. A successful read may return zero results if no items match the query. Check for results by calling the Vector.empty() method.

Technical Details

SBM ModScript version: 11.3.

Example

var v = [];
Shell.Db().ReadIntegerPairsWithSQL( 
    "select TS_ID, TS_SOLUTIONID from TS_TABLES where TS_TYPE=1", v );
Shell.Db().ReadIntegerPairsWithSQL( 
    "select TS_ID, TS_SOLUTIONID from TS_TABLES where TS_TYPE=?", v, 
    [Pair(DBTypeConstants.INTEGER,1)] );

Notes

None.

Related Topics

AppDb