Datatable
The datatable object is a set of datarow objects derived from reading an SQL string on the currently open database.
table = database.getsql("SELECT * FROM customers WHERE nation =’italy’")
nrows = table.countrows()
rows = table.getrows()
for i = 1, nrows do
customername = rows[i].getvalue("name")
output.print(customername)
end
*value* = *datatable*.countrows()
*value* = *datatable*.countrows()
Returns the current number of rows.
*value* = *datatable*.getrows()
*value* = *datatable*.getrows()
Returns the list of rows as datarow objects.
*datarow* = *datatable*.adddatarow()
*datarow* = *datatable*.adddatarow()
Adds a new row to the datatable.