revExecuteSQL | ||||||||||||||||
Type | command | |||||||||||||||
Dictionary | LCS | |||||||||||||||
Library | LiveCode Script | |||||||||||||||
Syntax |
| |||||||||||||||
Associations | database library | |||||||||||||||
Summary | ||||||||||||||||
Introduced | 2.0 | |||||||||||||||
Changes | The ability to specify array elements in the variablesList was added in 2.9 | |||||||||||||||
OS | mac, windows, linux, ios, android | |||||||||||||||
Platforms | desktop, server, mobile | |||||||||||||||
Parameters |
| |||||||||||||||
Example |
| |||||||||||||||
Values |
| |||||||||||||||
Related | Keyword: element Control Structure: function Function: revDatabaseTableNames, revOpenDatabase, result, revQueryDatabase, revDataFromQuery, revdb_execute Library: Database library Glossary: LiveCode custom library, prepend, binary file, variable, database, SQL, Standalone Application Settings, record, standalone application, array, SQL query, command | |||||||||||||||
Security | disk, network | |||||||||||||||
Description | Use the revExecuteSQL command to execute a SQL query without selecting records. The SQLStatement may contain one or more placeholders, which are sequential numbers prepended by a colon. The revExecuteSQL command substitutes the corresponding item in the variablesList for each of these placeholders. For example, if you have two variables called "valueX" and "valueY", you can use a SQLStatement that includes placeholders as follows:
The content of the variable valueX is substituted for the ":1" in the SQLQuery (in both places where ":1" appears), and the content of valueY is substituted for ":2".
If you specify an arrayName rather than a list of ordinary variables, the revExecuteSQL command substitutes the corresponding element of the array for each of the placeholders in the query:
The content of the element myArray[1] is substituted for the ":1" in the SQLQuery (in both places where ":1" appears), and the content of myArray[2] is substituted for ":2". To pass binary data in a variable in the variablesList, prepend "*b" to the variable name. The revExecuteSQL command strips the binary marker "*b" and passes it to the database as binary data, rather than text data. To pass binary data in an array element, prepend "*b" to the element's key.
| |||||||||||||||
Tags | database |