Write new records to a table
- Last UpdatedJun 17, 2024
- 1 minute read
You can insert new records to a database using the SQLInsert() function. The SQLInsert() function uses the current value of an InTouch tag to insert one record into a table. The SQLInsert() function is a one step operation that prepares, inserts, and ends the statement.
If the string associated with an InTouch message tag is longer than the defined size of the corresponding text field of the table, the number of characters used from the message tag will be the defined size of the field.
Note: InTouch tags cannot be NULL. It is impossible to update or insert NULL values into the database using these functions if the Bind List includes the field. You can insert NULL values into a field using SQLExecute on an INSERT statement that does not include the field, which should have been defined to allow NULL values.
SQL Access provides three other functions that separately prepare, insert, and clean up after a record insertion. Using these functions together, you can write scripts that include a single prepare and end statement and add as many record insert statements as needed. If you use individual functions to insert data instead of the SQLInsert() function, you can reduce resource usage on the computer.