Coding Dynamic SQL within an EXEC You Compile

Describes how to use dynamic SQL in and EXEC.
Some REXX SQL statements are inherently dynamic in nature. That is, the SQL request string is not known until run time. You can identify such genuinely dynamic SQL statements as such in your
RLX
EXEC by changing the Host Command prefix
RLX
to RDS (an acronymn for
RLX
Dynamic SQL). Coding RDS instead of
RLX
causes the Precompiler to ignore (neither extract nor translate) the dynamic SQL statement. For example, the following
RLX
statement appears in a
RLX
EXEC that is interpreted.
"RLX SELECT NAME, OWNER FROM" Db2_Table_name
Before the EXEC containing this inherently dynamic SQL statement is precompiled, change
RLX
to RDS as follows:
"RDS SELECT NAME, OWNER FROM" Db2_Table_name