By removing the levels of abstraction provided by SQL, a section can ensure the best performance during the execution of the statement. A SQL statement deals with a specific result set or target set; a set can consist of any number of rows and is treated as a whole by SQL. That is, SQL only recognizes sets of data, not individual rows. Because a section is physically accessing the data as individual rows, it has control at that level.
Each step in a section is based on what to do with the current row. The section returns data to the application on a row-by-row basis. Finally, by stripping away the abstraction of the SQL statement, a section allows the SQL statement and its result set to be represented by many different SQL methods getting that result set. Each individual section is a product of the environment in which it is compiled. This flexibility is valuable when supporting static and dynamic SQL created at different times in different contexts.
Although these two steps are sometimes combined into one from the user's perspective, they are actually two distinctly different steps from DB2 UDB's point of view. Precompilation occurs when application source files containing SQL statements and host variables are submitted to a precompiler.
A precompiler is specific to a programming language. Its job is to parse the application source to find any SQL statements and host variables, remove them, and then replace them in the source file with function calls and variables suitable to the programming language being used. The end result of precompilation is a modified version of the source file and the extracted SQL statements and variables. The latter can be stored in a file, called a bindfile.
This information can come directly from the precompilation step or from a bindfile. The process of creating a section from a SQL statement is referred to as compilation. It can also be referred to as optimization or preparing. The processes explained here apply to static and dynamic SQL statements.
The differences between these two processes arise when compilation occurs and the values are used for the compilation environment. Static SQL bases its compilation environment purely on the package information. The first step in the compilation of a SQL statement is the parsing stage. In this stage, the syntax of the SQL statement is validated and the statement is broken down into its component pieces. Using the information from the catalog tables for any referenced data objects or functions, an internal representation of the statement is constructed in the form of a graph.
QGM provides a concise and flexible representation of a statement. The connection is looking good! Driver Information Required File s : db2jcc.
The validation is completed. Search for:. Collectives on Stack Overflow. Learn more. Asked 2 years, 7 months ago. Active 2 years, 6 months ago.
Viewed times. PythonDeveloper PythonDeveloper 2 2 silver badges 12 12 bronze badges. Add a comment. Active Oldest Votes. Services By Product By Type. NET OData. Contact Us.
0コメント