ITPub博客

首页 > 数据库 > Oracle > DifferenceBetweenSQLAndPLSQL

DifferenceBetweenSQLAndPLSQL

原创 Oracle 作者:YoungEric 时间:2009-06-15 09:38:20 0 删除 编辑

DifferenceBetweenSQLAndPLSQL

Scott Urman: 过程化的语言都是线性语言,例如PL/SQL,它们以Begin开始,以End结束。虽然这只是非常简化的定义,但是它指出了过程化语言与面向对象语言之间的最根本的区别,每一条语句都必须等到它之前的语句执行完毕之后才能执行。

PL/SQL的特性中,笔者所喜欢的不是它与数据库的紧密结合(虽然它与数据库结合得非常完美),不是它拥有的高级语言的概念很功能,也不是它提供的某种功能,笔者所钟爱的是它结构化的程序设计方法。每一个BEGIN都会有一个END;每一个IF,都会有一个END IF.

PL/SQL是一种结构化的、线性的但不是很宽松的程序设计语言。结构并不能保证代码的优秀性,它只能使这种语言更易于学习。

什么是PL/SQL呢?它是SQL面向过程化(有时是面向对象的)程序设计语言上进行的扩展,它是由ORACLE开发,且专用于ORACLE的一种程序设计语言。

PL/SQL中的PL的意思就是过程化的语言。PL/SQL是一种专用语言,不能在ORACLE数据库以外的地方使用,它是第三代语言(third-generation language,3GL),支持与其它3GL语言相似的程序构造块,包含变量的声明、循环的使用以及出错处理等。从根源上讲,PL/SQL只是一种过程化的语言。

PL/SQLSQL的意思是结构化的查询语言(structured query language)

PL/SQLORACLE对结构化查询语言(Structured Query Language,SQL)面向过程化语言进行的扩展。SQL主要用途是从数据库中查询和操作数据,并将结果返回给终端用户和()将结果写入数据源。SQL就是数据库的窗口,而PL/SQL则是帮助开发PL/SQL功能的一个平台。

This chapter introduces PL/SQL, its origins, and its various versions. It also introduces you to what it means to be a PL/SQL programmer, and how PL/SQL programming differs from the kind of programming with which you may be familiar.

PL/SQL stands for "Procedural Language extensions to SQL." PL/SQL is available primarily as an "enabling technology" within other software products; it does not exist as a standalone language. You can use PL/SQL in the Oracle relational database, in the Oracle Server, and in client−side application development tools, such as Oracle Forms. PL/SQL is closely integrated into the SQL language, yet it adds programming constructs that are not native to this standard relational database language. As you can see from the following code example, PL/SQL allows you to combine SQL statements with "standard" procedural constructs.

Structured Query Language (SQL) is the set of statements with which all programs and users access data in an Oracle database. Application programs and Oracle tools often allow users access to the database without using SQL directly, but these applications in turn must use SQL when executing the user's request. This chapter provides background information on SQL as used by most database systems.

[@more@]

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/10484922/viewspace-1023104/,如需转载,请注明出处,否则将追究法律责任。

上一篇: OracleNull
请登录后发表评论 登录
全部评论

注册时间:2007-12-18

  • 博文量
    79
  • 访问量
    211246