The simplest use of dynamic SQL is when only non-SELECT statements are to be dynamically executed and the SQLDA does not have to be explicitly used.
Note: Because you know when you code this type of program how many parameter markers are to be included in the statement, you can code the USING clause of the EXECUTE statement with a list of variable names.
The steps taken by a program where only non-SELECT statements are dynamically executed are as follows:
EXEC SQL
PREPARE USERSTMT FROM :USERSTR
END-EXEC
DO UNTIL (CUSNO = 0)
EXEC SQL
EXECUTE USERSTMT USING :CUSNO
END-EXEC
ENDDO
|
Copyright © 2015 CA Technologies.
All rights reserved.
|
|