Datarow

The datarow object identifies a specific row of data belonging to a datatable or tableview object.

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* = datarow.getvalue(*columnname*)

Returns the value of a column.

datarow.setvalue(*columnname*,*value*)

Sets the value of a column.

*value* = datarow.tablename()

Returns the name of the table.

*value* = datarow.save()

Saves the current row by returning a boolean confirmation value.

Each datarow has the gguid column tha identifies the global ID of the row. If the value of gguid is a null string ("") or an alphanumeric of 6 characters, the row is new and will be inserted the database for the first time when saving. Otherwise it will be updated.