|
Database applications usually perform a specific activity and you know the complete SQL statement when you write and compile the script. When PowerBuilder does not support the statement in embedded SQL (for example, a DDL statement) or the parameters are unknown at compile time, the application must build the SQL statements at runtime. The parameters used in the dynamic SQL statements can change each time the program is executed.
You use dynamic SQL if the following situations exist at compile time:
- Non-result set statements with no input parameters
- Non-result set statements with input parameters
- Result set statements in which the input parameters and result set columns are known at compile time
- Result set statements in which the input parameters, the result set columns or both are unknown at compile time
To handle the situations described above, use:
The PowerBuilder dynamic SQL statements
The dynamic versions of CLOSE, DECLARE, FETCH, and OPEN
The PowerBuilder types DynamicStagingArea and DynamicDescriptionArea
|