Script consisting of SQL statements and/or actions.
In previous versions of USoft Developer, SqlScript() was used for a variety of purposes. SqlScript() will remain backward compatible in all respects. However, the core functionality of SqlScript is now to perform data manipulation (INSERT / UPDATE / DELETE) where a method call is expected.
The script may contain any statement used in the SQL Command tool. You can execute multiple SQL statements, separated by semicolons (;), provided that you start the script with:
SET QuitZeroRows False
The script may also contain an embedded SET statement determining how messages are displayed:
SET showMessages [True | False]
Default = False. If set to True, all messages of the Rules Engine are shown. If set to False, no messages are shown.
SET showErrorMessages [True | False]
Default = False. If set to True, and showMessages is set to False only messages for real errors such as constraint violations are shown.
This is only the case for constraints that are evaluated as a result of direct action (SqlScript()). It does not affect messages generated when corrective constraints cause restrictive constraints to be evaluated (triggered by decisions). Such messages are an indication that you have implemented contradictory rules and are always shown.
If you wish to turn off the display of ALL messages, you can use the -xrm "*messagesToFile: True" setting as a command line parameter when starting your application. This redirects all messages to a file. In this case, you will not see ANY messages. The file is named Messages .log, and is located in the standard logging folder specified during USoft setup.
SqlScript(UPDATE CUSTOMER SET STATUS = 'A' WHERE ID = :"query.cust_id()")