AppDB ReadTextValsWithSQL() Method

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

Function Signature

 bool ReadTextValsWithSQL( 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 string.

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. See Pair, Map_Pair, and Dictionary_Pair.

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

Notes

None.

Related Topics

AppDb