Database Loop
Posted: Sat Jun 25, 2011 7:42 pm
I am trying to construct a repeat loop that can loop through my database results but I'm not sure how to get
the data in the loop. Here is what I have so far.
This appears to return the id of the query livecode has assigned it. but from there i'm not sure how to get the data.
then i have my repeat loop which was using revDataFromQuery but I can't refer to the columns by name using revDataFromQuery
so its my understanding I need to change over to using revDataFromQuery to revQueryDatabase but I can't seem to find any
examples using it in a repeat loop so I'm not sure how to actually loop the data and refer to the columns in the loop.
Once again if anyone can come to my rescue that would be great!
the data in the loop. Here is what I have so far.
This appears to return the id of the query livecode has assigned it. but from there i'm not sure how to get the data.
Code: Select all
put revQueryDatabase(conID,tSQL) into tCursor
put revDataFromQuery(tab,return,conID,tSQL) into tRecords
so its my understanding I need to change over to using revDataFromQuery to revQueryDatabase but I can't seem to find any
examples using it in a repeat loop so I'm not sure how to actually loop the data and refer to the columns in the loop.
Code: Select all
repeat with i = 1 to the number of lines of tRecords
answer line i of tRecords
end repeat