SBM ModScript Reference → Programming SBM ModScript → Object Types → AppRecord → AppRecord ReadWithWhere() Method
(SBM On-Premise/PaaS only) Used to find a record by passing in a string containing a SQL "where" clause, not including the keyword "where".
Parameter | Type | Description |
---|---|---|
whereClause |
string |
The SQL "where" clause to find the specific record in the table, not including the keyword "where". |
queryParams |
Vector |
queryParams is an optional Vector storing SQL bind parameters, where each entry is a Pair, where the first value is the parameter type and the second value is the value to bind to the SQL parameter. For the type parameter, use DBTypeConstants. |
Type | Description |
---|---|
bool |
Returns true if the method found the record, in which case the calling object becomes a copy of the record found. If more than one record is found, the first one is copied to the calling object. |
SBM ModScript version: 11.3.
var record = Ext.CreateAppRecord(Ext.TableId("TS_CONTACTS")); var whereClause = "TS_CONTACTFIRSTNAME = 'Joe'"; myRecord.ReadWithWhere(whereClause);
Or:
var record = Ext.CreateAppRecord(Ext.TableId("TS_GROUPS")); record.ReadWithWhere("TS_NAME = ?", [Pair(DBTypeConstants.VARCHAR,"Everyone")]);
All fields will start with "TS_" and normal SQL syntax will apply. The calling object will become a copy of the first record found. This is the most general way of finding particular AppRecords.
Copyright © 2007–2018 Serena Software, Inc., a Micro Focus company. All rights reserved.