SQL Trigger
The SQL Trigger component can be used to publish data directly into an SQL Table from a card.
Common Use Properties
Execute Property Sets the rules used to determine in what instances data should and should not be sent to the database. Only accepts "Yes" (for should send data) and "No" (for should not send data), but a formula can be used to specify instances for each of these.
INFO
If set to "Yes", the trigger will run automatically on card load.
Query Property The SQL Query to be executed.
INFO
It is critical to parameterise queries within SQL Triggers to protect against potential security issues.
Example: select * from financial_transactions where id = ?
Query Parameters Property Add as many items as there are ? parameters and enter the values accordingly (in order of ? appearance).
Example: Query:
sql
INSERT INTO financial_transactions
(transaction_date, amount, transaction_type, description, account_number, user_id)
VALUES
(?,?,?,?,?,?)
Query Paramters: 2024-07-25, 100, Deposit, Test Deposit, ACC1, 1
Datasource Property The database to run the query in.