SQL Yoga version 1.1.0 build 4 :: Visit website

Printer friendly version

command sqlrecord_find

Finds records in the database and returns as SQL Record objects.

command sqlrecord_find pRecordA, pParamsA, @pRecordsA
Parameters
TypeNameDescription
Simple parameter. pRecordA Can be the name of a table or a SQL Record object. Pass in an object if you want to specify the connection and/or database to use. Otherwise default database and default database connection are assumed.
Simple parameter. pParamsA Pass a string to search on the primary key field for the table. In this case pRecordsA contains a single SQL Record object. Pass in an array whose keys are properties of a SQL Query object for more control over results. In this case an array of SQL Record objects is returned.
Simple parameter. @pRecordsA [out] Contains the found record(s).
Description

## Find lesson with id of 2 and store it in theRecordA 
sqlrecord_find "lessons", 2, theRecordA
put the result into theError
-- theRecordA contains a single SQL Record object

## Find lessons with ids of 12 or 15 and order by id
## Store result in theRecordsA
put "id is in :1" into theParamsA["conditions"]
put "12,15" into theParamsA["condition bindings"][1]
put "id ASC" into theParamsA["order by"]
sqlrecord_find "lessons", theParamsA, theRecordsA
put the result into theError
-- theRecordsA contains an array of SQL Records objects (numerically indexed)

Return

Error message