首页 | 本学科首页   官方微博 | 高级检索  
相似文献
 共查询到20条相似文献,搜索用时 671 毫秒
1.
针对嵌入式SQL编程技术,本文论述了C程序中嵌入SQL语句的代码格式,嵌入式SQL语言与C语言之间的通信方式以及嵌入式SQL应用程序在VC++6.0中的编译过程,并给出了直观的代码实例。  相似文献   

2.
针对关系代数中的交与差运算,重点分析了在SQL Server的环境下,如何设计一个通用的SQL查询语句,同时给出了两种运算的实现方法。通过实例验证了所设计的查询语句的有效性,并为更好地理解关系代数运算与SQL语句之间的关系奠定了基础。  相似文献   

3.
SQL差分     
研究定义在变化中的数据库上的查询。一个查询是一个函数,以数据库表为自变量,也以数据库表作函数值。SQL差分研究自变量变化对查询结果的影响,推导出法则以精确推断因自变量的变化而查询结果应该发生的变化,从而产生了查询差分的概念。对构成SQL查询的各种成份如投影、选择、联接、外联接、二元集合运算等分别研究了各自的差分生成规则,也研究了这些成份相互复合所产生的查询的差分构成方法,从而使所得出的方法几乎复盖了当前使用的大部分查询语句。以此为目的,为SQL查询设计了一套完善的代数符号以使对SQL查询进行代数推导成为可能,并据此发现了SQL系统中的许多鲜为人知的代数性质,有助于为SQL构造完整的理论基础以取代关系代数。  相似文献   

4.
C++语言是目前应用最广泛的程序设计语言,它所提供的各种特点有助于写出简单明了、有效且易于维护的程序。但C++语言的编译环境有一些不完善的地方,常常出现一些意想不到的错误,给编程者带来很大不便。本文谈谈笔者在C+十下编程时经常遇到的关于整数乘、除法运算和数组越界方面遇到的错误及解决办法。一、C+十语言不能自动进行长整数转换笔者在用C+十编程时,用整数作乘、除法运算时,运算结果经常出现一些随机数,和实际运算结果相差很远,后来发现:两个整数相乘时,若乘积为长整数,编译程序不能自动转换为长整数,需在乘积…  相似文献   

5.
数据库系统的查询优化技术是提高数据库系统效率的重要技术。当今Java和C++等主流程序设计语言依靠SQL语句,造成数据库系统中查询复杂、繁琐、效率低下、可靠性得不到保证等。针对上述问题,在PAR(Partition And Recur)平台数据库关系代数实现机制基础上,提出和实现基于关系代数的查询优化规则设计方法。这种设计不仅提高了数据库查询效率,也为高可靠数据库的形式化开发提供了依据。  相似文献   

6.
本文通过对TurboC/C^++中的几种指针的介绍,引出C/C^++的六种存储模式,并讨论了在程序编译时,存储模式指针的关系,指出了在实际应用中应注意的一些问题。  相似文献   

7.
基于C/C++与ORACLE9i的嵌入式SQL编程技术   总被引:6,自引:4,他引:6  
针对嵌入式SQL编程技术,本文论述了C/C 语言与ORACLE9i的嵌入式SQL的形式,嵌入式SQL语句与C/C 宿主语言之间的通信.并给出了代码实例。  相似文献   

8.
基于SQL Server的嵌入式SQL编程   总被引:1,自引:1,他引:0  
黄欣 《福建电脑》2010,26(5):127-128
本文介绍嵌入式SQL编程的主要原理,并给出基于SQL Server和VC++6.0进行嵌入式SQL编程的详细步骤和一个使用嵌套游标技术的编程示例。  相似文献   

9.
C++面向对象程序设计的几点思考   总被引:1,自引:0,他引:1  
分析了利用C++开发面向对象程序时容易出现的若干问题,并从向面向时象的程序设计思维方式;类的设计;模版的使用;库的利用;程序的健壮性的设计五个方面论述了C++如何进行高质量的面向对象程序设计。  相似文献   

10.
针对嵌入式SQL编程技术,本文论述了C程序中嵌入SQL语句的代码格式,嵌入式SQL语言与C语言之间的通信方式以及嵌入式SQL应用程序在VC 6.0中的编译过程,并给出了直观的代码实例。  相似文献   

11.
本文提出一种将关系数据库的一类嵌套SQL查询转换为代数运算的一种简化方法,该方法使这类查询的SQL语句简洁易懂,避免了SQL语句的多层嵌套。  相似文献   

12.
基于DTD的XML与SQL查询转换算法   总被引:1,自引:0,他引:1       下载免费PDF全文
卜莉  李军怀  张璟 《计算机工程》2007,33(16):41-43
针对如何将XML查询转换成SQL查询提出了一个XSLT查询到SQL查询的转换框架和算法,研究了文档类型定义(DTD)和关系模式的相互映射方法及基于XML DTD且不使用任何中间语言将XSLT查询转换为SQL查询的具体过程和算法:从XSLT代码中抽取指令集合,合并、简化并分割其中的XPath,最后抽取出SQL语句的各个组成部分。该算法具有较高的通用性。  相似文献   

13.
实现了一个嵌入式SQL 系统, 支持在C 语言中嵌入SQL 语句。该系统是对象关系型数据库管理系统OSCAR 客户端的重要组成部分, 分为两部分实现: 预处理模块和ESQL 运行库。预处理模块根据ESQL 语言的语法规则分析和识别ESQL 语句, 并且转换为实现相同功能的C 语言函数调用; ESQL 运行库实现这些C 函数, 通过网络通信库与服务器端通信, 并执行SQL 语句, 返回结果值。  相似文献   

14.
Most large software applications rely on an external relational database for storing and managing persistent data. Typically, such applications interact with the database by first constructing strings that represent SQL statements, and then submitting these for execution by the database engine. The fact that these statements are only checked for correctness at runtime is a source for many potential defects, including type and syntax errors and vulnerability to injection attacks.The AraRat system presented here offers a method for dealing with these difficulties by coercing the host C++ compiler to do the necessary checks of the generated strings. A library of templates and preprocessor directives is used to embed in C++ a little language representing an augmented relational algebra formalism. Type checking of this embedded language, carried out by our template library, assures, at compile-time, the correctness and safety of the generated SQL strings. All SQL statements constructed by AraRat are guaranteed to be syntactically correct, and type safe with respect to the database schema. Moreover, AraRat statically ensures that the generated statements are immune to all injection attacks.The standard techniques of “expression templates” and “compile-time symbolic derivation” for compile-time representation of symbolic structures, are enhanced in our system. We demonstrate the support of a type system and a symbol table lookup of the symbolic structure. A key observation of this work is that type equivalence of instantiated nominally typed generics in C++ (as well as other languages, e.g., Java) is structural rather than nominal. This makes it possible to embed the structural type system, characteristic to persistent data management, in the nominal type system of C++.For some of its advanced features, AraRat relies on two small extensions to the standard C++ language: the typeof pseudo operator and the __COUNTER__ preprocessor macro.  相似文献   

15.
The gap between storing data in relational databases and transferring data in form of XML has been closed e.g. by SQL/XML queries that generate XML data out of relational data sources. However, only few relational database systems support the evaluation of SQL/XML queries. And even in those systems supporting SQL/XML, the evaluation of such queries is quite slow compared to the evaluation of SQL queries. In this paper, we present S2CX, an approach that allows to efficiently evaluate SQL/XML queries on any relational database system, no matter whether it supports SQL/XML or not. As a result to an SQL/XML query, S2CX supports different output formats ranging from plain XML to different compressed XML representations including a succinct encoding of XML data, schema-aware compressed XML to grammar compressed XML. In many cases, S2CX produces compressed XML as a result to an SQL/XML query even faster than the evaluation of SQL/XML queries into non-compressed XML as provided by Oracle 11 g and by DB2. Furthermore, our approach to query evaluation scales better, i.e., the larger the dataset, the faster is our approach compared to SQL/XML query evaluation in Oracle 11 g and in DB2.  相似文献   

16.
张颖超  王慧 《计算机应用研究》2008,25(10):2917-2919
目前 SQL模糊扩展查询已经研究了带权重的模糊简单查询、复合查询、多表查询、子查询、全关系查询等,在一定程度上解决了查询中的模糊型问题 ,但对于带模糊语言量词的查询研究不多。基于 Zadeh的模糊理论将模糊理论与 SQL系统函数相结合 ,提出了一种解决含模糊语言量词的 SQL查询方法 ,进一步丰富了 SQL模糊查询体系 ,扩展了 SQL模糊查询的应用范围 ,提高了查询能力。  相似文献   

17.
正则表达式在数据库查询中的应用   总被引:1,自引:0,他引:1  
SQL语句在数据库查询中具有非常重要的地位,但是标准的SQL语句在复杂的数据库查询中却存在着诸多不足。而正则表达式有着强大的查询功能,通过对正则表达式特殊字符以及数据库查询语言中谓词的分析,提出了将正则表达式运用于数据库查询当中的新查询方法,并对该方法在实际查询应用当中会遇到的几个普遍问题进行了探讨。从而证明该方法不仅可以降低查询语句的复杂程度而且还能简化对出错语句的修改工作。  相似文献   

18.
The Semantic Web’s promise of web-wide data integration requires the inclusion of legacy relational databases,1 i.e. the execution of SPARQL queries on RDF representation of the legacy relational data. We explore a hypothesis: existing commercial relational databases already subsume the algorithms and optimizations needed to support effective SPARQL execution on existing relationally stored data. The experiment is embodied in a system, Ultrawrap, that encodes a logical representation of the database as an RDF graph using SQL views and a simple syntactic translation of SPARQL queries to SQL queries on those views. Thus, in the course of executing a SPARQL query, the SQL optimizer uses the SQL views that represent a mapping of relational data to RDF, and optimizes its execution. In contrast, related research is predicated on incorporating optimizing transforms as part of the SPARQL to SQL translation, and/or executing some of the queries outside the underlying SQL environment.Ultrawrap is evaluated using two existing benchmark suites that derive their RDF data from relational data through a Relational Database to RDF (RDB2RDF) Direct Mapping and repeated for each of the three major relational database management systems. Empirical analysis reveals two existing relational query optimizations that, if applied to the SQL produced from a simple syntactic translations of SPARQL queries (with bound predicate arguments) to SQL, consistently yield query execution time that is comparable to that of SQL queries written directly for the relational representation of the data. The analysis further reveals the two optimizations are not uniquely required to achieve a successful wrapper system. The evidence suggests effective wrappers will be those that are designed to complement the optimizer of the target database.  相似文献   

19.
Theoretical models used in database research often have subtle differences with those occurring in practice. One particular mismatch that is usually neglected concerns the use of marked nulls to represent missing values in theoretical models of incompleteness, while in an SQL database these are all denoted by the same syntactic
object. It is commonly argued that results obtained in the model with marked nulls carry over to SQL, because SQL nulls can be interpreted as Codd nulls, which are simply marked nulls that do not repeat. This argument, however, does not take into account that even simple queries may produce answers where distinct occurrences of
do in fact denote the same unknown value. For such queries, interpreting SQL nulls as Codd nulls would incorrectly change the semantics of query answers. To use results about Codd nulls for real-life SQL queries, we need to understand which queries preserve the Codd interpretation of SQL nulls. We show, however, that the class of relational algebra queries preserving Codd interpretation is not recursively enumerable, which necessitates looking for sufficient conditions for such preservation. Those can be obtained by exploiting the information provided by NOT NULL constraints on the database schema. We devise mild syntactic restrictions on queries that guarantee preservation, do not limit the full expressiveness of queries on databases without nulls, and can be checked efficiently.  相似文献   

20.
赵猛  陈珂  寿黎但  伍赛  陈刚 《软件学报》2022,33(12):4727-4745
自然语言查询转SQL(NL2SQL)是指将自然语言表达的查询文本自动转化成数据库系统可以理解并执行的结构化查询语言SQL表达式的技术.NL2SQL可以为普通用户提供数据库查询访问的自然交互界面,从而实现基于数据库的自然问答.复杂查询的NL2SQL是当前数据库学术界的研究热点,主流方法采用序列到序列(Seq2seq)的编解码方式对问题进行建模.然而,已有的工作大多基于英文场景,面向中文领域实际应用时,中文特殊的口语化表达导致复杂查询转化困难;此外,现有工作难以正确输出包含复杂计算表达式的查询子句.针对上述问题,提出一种树状模型取代序列表示,将复杂查询自顶向下分解为多叉树,树结点代表SQL的各组成元素,采用深度优先搜索来预测生成SQL语句.在Du SQL中文NL2SQL竞赛的两个官方测试集中,该方法分别取得了第1名和第2名的成绩,验证了其有效性.  相似文献   

设为首页 | 免责声明 | 关于勤云 | 加入收藏

Copyright©北京勤云科技发展有限公司  京ICP备09084417号