首页>
外国专利>
System, method, and program for extending a SQL compiler for handling control statements packaged with SQL query statements
System, method, and program for extending a SQL compiler for handling control statements packaged with SQL query statements
展开▼
机译:用于扩展用于处理与SQL查询语句一起打包的控制语句的SQL编译器的系统,方法和程序
展开▼
页面导航
摘要
著录项
相似文献
摘要
This invention provides an integrated compiler for compiling SQL3 control statements having procedural, i.e., control, information packaged together with query, i.e., non-procedural, statements. A query extractor contained within the parser extracts the query statement from the control statement leaving a control skeleton. The query statement is processed as usual through a query compiler for generating executable plans with the exception that the name resolution function for resolving variables is modified for looking up local variables. This modification takes into account the mapping of local and host variables to create a unification of local and host variables. The control skeleton is processed through a control analyzer which generates a representation of the control flow and a scope and symbol table. The control analyzer also unifies the local and host variables. A plan synthesizer then takes as input the control flow information, symbol tables, and individual executable plans for the query statements and generates a meta-plan comprising a merger of a top level plan for the control skeleton and sub- plans representing the executable plans of the query statement. Therefore, this invention provides a uniform way of treating local and host variables, provides an efficient way of performing bind-in/bind-out processes, creates a single execution plan requiring only a single run- time interpreter, and requires minimum enhancements to existing SQL2 compilers. In addition, this invention enables the application of global optimization techniques for optimizing both the control aspects and query aspects of the original control statement.
展开▼