sc_exec_sql with error handling
The macro sc_exec_sql() is used in Scriptcase to execute SQL commands. Unfortunately it does not return errors when executed.
As another way the macro
sc_select() can be used to execute SQL commands.
And it is abe to return (and analyse) the errors.
Hint: sc_select can be used to execute ANY SQL commands, not only to select data.
If you want to execute SQL-commands as UPDATE, INSERT,DELETE,… just ignore any returned data. Only check if the {recordset} equals false.
Sample:
1 2 3 4 |
if ({my_data} === false) { echo "SQL error. Message =". {my_data_erro}; } |