Scripting and SQL

Previous Next

Action scripts that programmatically make things happen in the GUI interface, such as raising a tab page or opening a window when a user clicks a button, are one thing.

USoft applications are data-intensive and therefore you can easily mix action statements with SQL using the SqlScript() action and decisions.

The SqlScript() action provides a way to execute SQL in an action script context:

Using SELECT, this allows you to retrieve values from the database or the screen, and display them in the screen or store them in global variables.

Using INSERT, UPDATE or DELETE, this also allows you to get values from the screen or from global variables and use them in a data manipulation operation in the database.

The decision construct provides a way to execute an SQL query and run an action script (called the "Yes Action") for each of the query results or, if the result returns no records, run an alternative action script (called the "No Action"). The ActionDecision() action allows you to call a decision from an action script, during which call you can optionally pass input parameters.

This help topic contains typical examples of tasks that require a mix of action statements and SQL.

 

 

collapseExample 1: Getting a value from a field
collapseExample 2: Setting a field to a value
collapseExample 3: Performing actions based on screen data
collapseExample 4: Performing actions based on retrieved data
collapseExample 5: Export file name based on screen data

 

 

See Also

FORMULA()

Actions

Scripting in USoft Windows Designer