In the Yes Action and No Action scripts, instead of picking up an output value from the Decision SQL in a numbered placeholder (:1, :2...), you can take the intermediary step of first storing the value in a global variable. The ResourceFileUpdate() action allows you to do this. The syntax for storing a value in this way is:
ResourceFileUpdate( 'variable-name : variable-value' )
The stored value is now named and may be accessed repeatedly by name until it is cleared or reset. The syntax for accessing a stored value is:
:"variable"
One special reason for using global variables is that you need them to substitue values in SqlScript() statements. See the next section in this help topic for details.
The general pattern for catching a value in a global variable is:
(Decision SQL:)
SELECT value1
, value2 ...
(Yes Action:)
ResourceFileUpdate( 'name1:' ) || :1
ResourceFileUpdate( 'name2:' ) || :2
... :"name1" ...
... :"name2" ...
An example of this pattern is:
(Decision SQL:)
SELECT T_RDMI_AUTOMATION_SERVER
, T_RDMI_JAVA_COMPONENT,
FROM T_RDMI_COMPONENT
WHERE COMPONENT_NAME= :1
(Yes Action:)
ResourceFileUpdate( 'global.automation:' || :1 )
ResourceFileUpdate( 'global.java:' || :2 )
SqlScript(
UPDATE appcomponent
SET processed = 'Y'
WHERE autom = :"global.automation"
AND java_class = :"global.automation"
)
|