SQL Yoga version 1.0.1 build 1 :: 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. Pass in an array whose keys are properties of a SQL Query object for more control over results.
Simple parameter. @pRecordsA [out] Contains the found records.
Description

## Find lesson with id of 2 and store it in theRecordA 
sqlrecord_find "lessons", 2, theRecordA
put the result into theError

## 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 "1,2" into theParamsA["condition bindings"][1]
put "id ASC" into theParamsA["order by"]
sqlrecord_find "lessons", theParamsA, theRecordsA
put the result into theError

Return

Error message