首页> 外国专利> 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.
机译:本发明提供了一种用于编译SQL3控制语句的集成编译器,该SQL3控制语句具有与查询(即非过程语句)打包在一起的过程即控制信息。解析器中包含的查询提取器从控制语句中提取查询语句,从而留下控件框架。通常通过查询编译器处理查询语句以生成可执行计划,不同之处在于修改了用于解析变量的名称解析功能以查找局部变量。此修改考虑了局部变量和宿主变量的映射,以创建局部变量和宿主变量的统一。通过控制分析器处理控制框架,该分析器生成控制流的表示以及作用域和符号表。控制分析器还统一了本地变量和主机变量。计划合成器然后将控制流信息,符号表和查询语句的各个可执行计划作为输入,并生成一个元计划,其中包括控制框架的顶层计划和代表以下项目的可执行计划的子计划的合并查询语句。因此,本发明提供了一种处理局部变量和宿主变量的统一方法,提供了一种执行绑定/绑定过程的有效方法,创建了仅需要单个运行时解释器的单个执行计划,并且对现有技术的增强要求最小。 SQL2编译器。另外,本发明使得能够应用全局优化技术来优化原始控制语句的控制方面和查询方面。

著录项

相似文献

  • 专利
  • 外文文献
  • 中文文献
获取专利

客服邮箱:kefu@zhangqiaokeyan.com

京公网安备:11010802029741号 ICP备案号:京ICP备15016152号-6 六维联合信息科技 (北京) 有限公司©版权所有
  • 客服微信

  • 服务号