Although the docs don't explain this very well (I've updated them for the next release), sqlrecord_find behaves differently based on whether or not you pass an array in for the second param.
When you pass in an array for the search conditions an array of SQL Record objects is returned. This is why you see the [1]. When you pass in a string then a single SQL Record object is returned.
In your case you could just do this:
Code: Select all
put theRecordA[1]["DO_INVOICE"] into theRecordA
Now you can call sqlrecord_set and it should work. You can just pass theRecordA[1] to sqlrecord_set because LiveCode does not yet support passing array subkeys by reference.
Note: I don't know if the version of SQL Yoga that you are using supports this but the next release will have a "find" property that you can pass in. If you set it to "first" then a single SQL Record object will be returned rather than an array of SQL Record objects.
Code: Select all
put "first" into theParamsA["find"]