AppDB ReadIntegersWithSQL() Method

(SBM On-Premise/PaaS only) Reads multiple rows of a single integer column from the database, filling the Vector "out".

Function Signature

 bool ReadIntegersWithSQL( 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 an int.

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.ReadIntegersWithSQL( 
    "select TS_SOLUTIONID from TS_TABLES where TS_TYPE=1", v ); 
Shell.Db.ReadIntegersWithSQL( 
    "select TS_SOLUTIONID from TS_TABLES where TS_TYPE=?", v, 
    [Pair(DBTypeConstants.INTEGER,1)] );

Notes

None.

Related Topics

AppDb