SQL Yoga version 1.1.0 build 4 :: Visit website

Printer friendly version

command sqlquery_convertToRecords

Converts a SQL Object's open database cursor into records.

command sqlquery_convertToRecords @pQueryA, @pOutRecordsA
Simple parameter. @pQueryA A SQL Query Object array.
[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.

When converting a cursor to records any relationships that have been defined 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"


Error message.