| United States-English |
|
|
|
![]() |
ALLBASE/SQL Pascal Application Programming Guide: HP 9000 Computer Systems > Chapter 6 Overview Of Data ManipulationDynamic Operations |
|
Dynamic operations offer a way to execute SQL commands that cannot be completely defined until run time. You accept part or all of an SQL command that can be dynamically preprocessed from the user, then use one of the following techniques to preprocess and execute the command:
To determine whether a dynamic command is a query, you use the DESCRIBE command after preparing the dynamic command:
Dynamic queries require special handling because you may not know in advance what a query result will look like. The number and type of columns, the existence of null values, the column names...this and other information may need to be obtained by the program at run time because it is not known at programming time. To obtain the information needed to parse any query result at run time, you use three special data structures in your program: the SQLDA, a format array, and a data buffer:
The following example summarizes how you declare and use these data structures:
Techniques for parsing the data buffer and more examples of dynamic preprocessing are in the chapter, "Using Dynamic Operations." |
|||||||||||||||||||||||||||||||||||||||||||||||||
|
|||||||||||||||