SQL Yoga version 1.1.0 build 4 :: Visit website

Printer friendly version

command sqlquery_retrieveAsRecords

Executes a SQL Query Object query and returns the result as a Records array.

command sqlquery_retrieveAsRecords @pQueryA, @pOutRecordsA
Parameters
TypeNameDescription
Simple parameter. @pQueryA A SQL Query Object array as created using sqlquery_createObject().
[Pointer] Write only variable. @pOutRecordsA Upon completion holds a numerically indexed array. If you pass in an array that already has numerical indexes then the array will be added to.
Description

When retreiving query results as records any relationships that have been defined using Table and Relationship objects will be used to transform the flat SQL results into a hierarchy representing defined relationships. Each record will have a "@table" key in the array that contains the name of the table the record represents.

An example of a Records array that has a lesson table with step table children.

theRecordsA[1]["@table"] = "lesson" 
theRecordsA[1]["id"] = "12"
theRecordsA[1]["title"] = "my lesson title"
theRecordsA[1]["steps"][1]["@table"] = "steps"
theRecordsA[1]["steps"][1]["id"] = "36"
theRecordsA[1]["steps"][1]["title"] = "My step title"
theRecordsA[1]["steps"][2]["@table"] = "steps"
theRecordsA[1]["steps"][2]["id"] = "58"
theRecordsA[1]["steps"][2]["title"] = "Another step title"

Return

Error message