The name of the table on which the check will be performed
fieldname
string
The name of the field that will be searched within the table
Examples
bool = database.fieldexist("orders","customer")
getconst
Description
Retrieves the value of a database constant
Value Type
string
Format
string = database.getconst(key)
Type
Method
Systems
Windows, Web, Android, IOS, Mac OS
Parameter
Value Type
Description
key
string
The key of the constant
getind
Description
Returns the incremental index to be associated with a new record
Value Type
integer
Format
integer = database.getind(tablename)
Type
Method
Systems
Windows, Web, Android, IOS, Mac OS
Parameter
Value Type
Description
tablename
string
The name of the table from which to extract the index to use
Examples
integer = database.getind("orders")
getsql
Description
Executes an SQL command to retrieve records from the database
Value Type
datatable
Format
datatable = database.getsql(sql)
Type
Method
Systems
Windows, Web, Android, IOS, Mac OS
Parameter
Value Type
Description
sql
string
The SQL string to be executed
Examples
datatable = database.getsql("SELECT * FROM orders WHERE arc=2")
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
incrementcounter
Description
Increments a global counter by one
Value Type
Format
database.incrementcounter(gcounter)
Type
Method
Systems
Windows, Web, Android, IOS, Mac OS
Parameter
Value Type
Description
gcounter
string
The unique identifier of the global counter
Examples
database.incrementcounter("XXX-XXX")
iscloud
Description
Returns true or false depending on whether the database is a cloud database
Value Type
boolean
Format
boolean = database.iscloud()
Type
Method
Systems
Windows, Web, Android, IOS, Mac OS
list_addvalue
Description
Adds an element to an existing list in the database
Value Type
Format
database.list_addvalue(listname, value)
Type
Method
Systems
Windows, Web, Android, IOS, Mac OS
Parameter
Value Type
Description
listname
string
The name of the list
value
string
The value to add to the list
list_getvalues
Description
Returns the values contained in a list
Value Type
list<string>
Format
list<string> = database.list_getvalues(listname)
Type
Method
Systems
Windows, Web, Android, IOS, Mac OS
Notes
You can pass either the name of the list or its gguid
Parameter
Value Type
Description
listname
string
The name of the list to query
name
Description
Retrieves the serial number of the database
Value Type
string
Format
string = database.name
Type
Property
Systems
Windows, Web, Android, IOS, Mac OS
newdatafield
Description
Creates a new object of type datafield
Value Type
datafield
Format
datafield = database.newdatafield()
Type
Method
Systems
Windows, Web, Android, IOS, Mac OS
newdatarow
Description
Creates a new datarow object that contains a new unsaved record
Value Type
datarow
Format
datarow = database.newdatarow(tablename)
Type
Method
Systems
Windows, Web, Android, IOS, Mac OS
Parameter
Value Type
Description
tablename
string
The name of the table from which the new record will be created
The file name is taken from the data used to upload the image. If the name is missing or cannot be used, the system uses the gguid of the file as the name
Parameter
Value Type
Description
tablename
string
The name of the table from which to retrieve the image
fieldname
string
The name of the field from which to retrieve the image
gguidrecord
string
The gguid of the record from which to retrieve the image
savepath
string
The folder where the file is saved
rootname
string
An optional prefix to add at the beginning of the file name
setconst
Description
Sets the value of a database constant
Value Type
Format
database.setconst(key, value)
Type
Method
Systems
Windows, Web, Android, IOS, Mac OS
Notes
If the constant does not exist, it is created automatically with the given key
Parameter
Value Type
Description
key
string
The key of the constant
value
string
The value of the constant
setsql
Description
Executes an SQL command on the database
Value Type
boolean
Format
boolean = database.setsql(sql)
Type
Method
Systems
Windows, Web, Android, IOS, Mac OS
Parameter
Value Type
Description
sql
string
The SQL command to be executed
tableexist
Description
Checks if a specific table exists within the database
Value Type
boolean
Format
boolean = database.tableexist(tablename)
Type
Method
Systems
Windows, Web, Android, IOS, Mac OS
Parameter
Value Type
Description
tablename
string
The name of the table to check
uploadfiletoserver
Description
Sends a file saved in the database to the Nios4 server, returning a link to download it