Follow these steps to define Flex SQL procedures.
Open the Flex SQL statement definition form (YMFLXS).
Table—Click to select the Datastream 7i table that initiates the event.
Trigger—Click to select the database operation that initiates the event. Datastream 7i supports postinsert and postupdate triggers.
Sequence number—Enter the order of Flex SQL processing.
Comment—Enter a description of the purpose of the Flex SQL statement.
SQL statement—Enter the SQL statement to be executed when the specified operation takes place for a table.
Failure message—Enter the message to display when the Flex SQL statement fails. A Flex SQL statement is successful when one or more rows in a table are processed by the statement. A Flex SQL statement fails when no rows are processed. To make the failure message active, select Abort on failure.
Must exist—Select to make the Flex SQL processor stop processing consecutive Flex SQL statements when no rows are processed by the current statement.
Abort on failure—Select to stop the current operation when it fails and issue an error. Specify a failure message if you select this option.
Reverse return code—Select to reverse the return status code for the current Flex SQL statement. If selected and the statement processes one or more rows, then the processor returns with a failure status. If the statement processes no rows, then the processor returns a success status.
Active—Select to enable the Flex SQL statement.
Click Test SQL to ensure that the current Flex SQL statement is valid. If the statement contains errors (invalid syntax, for example), Datastream 7i displays a message.
Choose File | Save from the menu bar. Datastream 7i saves the information to the database.