SQL Functions
SQL Functions
Syntax
(AfmWebServicesSQL strAssetType strSQL fieldList sortFieldList bAscending dMaxRecords)
Comments
This function gets records for the current project. This function differs from the other Get Record functions in that instead of passing in a list of restrictions, the function specifies the SQL where clause.
strAssetType
is a table name in the database where the record will be retrieved from. (required)
strSQL
is the SQL that defines the where clause. (required)
fieldList
is a list of fields to retrieve for this record. (optional, If set as nil, only the primary key values will be returned in the record.)
sortFieldLis
t is an optional list of fields that specifies the sort order. (optional. If set as nil, no sorting will be applied.)
bAscending
specifies whether to sort per the sortFieldList ascending or descending. (optional. If set as nil, the default is to sort ascending.)
dMaxRecords
specifies the maximum number of records to retrieve. (optional. If set to nil, all records satisfying the specified SQL will be retrieved.)
Example
The following example returns a list of records for building HQ and floor 17 from the current project
(setq records
(AfmWebServicesSQL
"rm"
"rm.bl_id = 'HQ' AND rm.fl_id = '17'"
(list "rm.rm_std")
(list "rm.rm_std")
'T
50
)
)