...
The Live Flag to set
live=true
. However, use this cautiously – each script change or use of sample data will trigger the SQL execution, potentially leading to multiple unintended INSERTs or UPDATEs.The
component.live()
API to control code execution in test and live.
Code Block | ||
---|---|---|
| ||
local values = {'John', 'Smith', '1980-01-01', 'Male'} local T = {} for i, v in ipairs(values) do T[i] = conn:quote(v) -- safely quote each value end local sqlInsert = 'INSERT INTO Patients (FirstName, LastName, DOB, Gender) VALUES ('..table.concat(T, ', ')..')' -- Execute SQL Insert local result = conn:execute{sql=sqlInsert, live=true} |
...