The object represents a data table. The datatable is a set of datarow objects obtained by running an SQL string on the currently open database.
Availability
The object is returned by a method or a property of another object
Pre-initialized in
All scripts
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
adddatarow
Description
Adds a new datarow object to the collection of rows present within the table
Value Type
datarow
Format
datarow = datatable.adddatarow()
Type
Method
Systems
Windows, Web, Android, IOS, Mac OS
Examples
row = datatable.adddatarow()
countrows
Description
Returns the number of datarows present in the table
Value Type
single
Format
single = datatable.countrows()
Type
Method
Systems
Windows, Web, Android, IOS, Mac OS
Examples
number_row = datatable.countrows()
deletedatarow
Description
Deletes a specific datarow from the table
Value Type
boolean
Format
boolean = datatable.deletedatarow(row)
Type
Method
Systems
Windows, Web, Android, IOS, Mac OS
Parameter
Value Type
Description
row
datarow
The datarow object to delete
Examples
bool = datatable.deletedatarow(row)
getrows
Description
Retrieves the complete list of datarows present in the table