pl/sql编程_PL / SQL编程简介

pl/sql编程

PL/SQL Basics – Introduction to PL/SQL Programming

PL/SQL stands for Procedural Language/Structured Query Language. It is an extension of Structured Query Language (SQL) developed by Oracle Corporation.

PL/SQL is a database programming language which is used to modify and manipulate the database or a complete database application. PL/SQL provides support for developing Web Applications and Server Pages. PL/SQL can be both a server-side and a client-side database programming language.

We shall be teaching Oracle PL/SQL. However, it will form a strong base for you to manage other databases such as Sybase, NoSQL, MongoDB, etc.

PL/SQL is basically used to execute “queries” or “tasks” (in an easy way) to update or delete or modify or add data into the database.

The prerequisite for PL/SQL is SQL. But, don’t worry if you’re not well versed with SQL. Here, I shall also be giving you hints regarding SQL language and soon would be updating a complete tutorial on SQL.

PL/SQL is one of the top most ranked programming languages for handling databases. Many big companies still use this language for their database operations. So, there are many job opportunities with PL/SQL on your Resume.

The major difference between Structures Query Language(SQL) and Procedural Language/Structured Query Language(PL/SQL) is that the former is a single line or a single statement or a single query executer whereas the latter takes multiple queries at one time in the form of a “block”.

PL/SQL Block

A Block contains more than one number of lines of statements to be executed at one point of time.

SQL executes one query at a time. It executes a single insert/update/delete query at a given time whereas PL/SQL can execute more than a single query in the form of a block. It makes use of terms such as loops, cursors, variables, etc to execute queries. We shall learn more about this in the upcoming PL/SQL tutorials.

PL/SQL optionally uses or requires grouping multiple instructions or statement in a single block and sending the entire block for execution in a single call.

A block of PL/SQL program code contains basically three sections as follows:

1. Declaration Section
2. Execution Section
3. Exception Section

These mentioned sections appear order wise in a PL/SQL Block and cannot be interchanged but can be omitted as per the needs.

Declaration Section
This is an optional section. This section starts with the keyword ‘DECLARE’. This section is used to declare variables, constants, records and cursors, which are used to modify/update/delete/manipulate data in the execution section.
Execution Section
This is a compulsory section for the proper execution of a PL/SQL block or a program. This is the section where the logic of the program or the PL/SQL block is to be mentioned. This section starts with the keyword “BEGIN” and ends with  with the keyword “END”. This section makes use of terms such as SQL statements, Loops and Conditional Statements.

Note: PL/SQL has tight integration with SQL

Exception Section

The Exception section of a PL/SQL Block is an optional section. This section starts with the keyword “EXCEPTION”. This section is used to handle any errors that occur during program execution. It helps normal termination of an abnormal program.

This was all about the introduction to PL/SQL programming. Let us know if you have any queries in the comment section below.

PL/SQL Basics – Introduction to PL/SQL Programming

PL/SQL stands for Procedural Language/Structured Query Language. It is an extension of Structured Query Language (SQL) developed by Oracle Corporation.

PL/SQL is a database programming language which is used to modify and manipulate the database or a complete database application. PL/SQL provides support for developing Web Applications and Server Pages. PL/SQL can be both a server-side and a client-side database programming language.

We shall be teaching Oracle PL/SQL. However, it will form a strong base for you to manage other databases such as Sybase, NoSQL, MongoDB, etc.

PL/SQL is basically used to execute “queries” or “tasks” (in an easy way) to update or delete or modify or add data into the database.

The prerequisite for PL/SQL is SQL. But, don’t worry if you’re not well versed with SQL. Here, I shall also be giving you hints regarding SQL language and soon would be updating a complete tutorial on SQL.

PL/SQL is one of the top most ranked programming languages for handling databases. Many big companies still use this language for their database operations. So, there are many job opportunities with PL/SQL on your Resume.

The major difference between Structures Query Language(SQL) and Procedural Language/Structured Query Language(PL/SQL) is that the former is a single line or a single statement or a single query executer whereas the latter takes multiple queries at one time in the form of a “block”.

PL/SQL Block

A Block contains more than one number of lines of statements to be executed at one point of time.

SQL executes one query at a time. It executes a single insert/update/delete query at a given time whereas PL/SQL can execute more than a single query in the form of a block. It makes use of terms such as loops, cursors, variables, etc to execute queries. We shall learn more about this in the upcoming PL/SQL tutorials.

PL/SQL optionally uses or requires grouping multiple instructions or statement in a single block and sending the entire block for execution in a single call.

A block of PL/SQL program code contains basically three sections as follows:

1. Declaration Section
2. Execution Section
3. Exception Section

These mentioned sections appear order wise in a PL/SQL Block and cannot be interchanged but can be omitted as per the needs.

Declaration Section
This is an optional section. This section starts with the keyword ‘DECLARE’. This section is used to declare variables, constants, records and cursors, which are used to modify/update/delete/manipulate data in the execution section.
Execution Section
This is a compulsory section for the proper execution of a PL/SQL block or a program. This is the section where the logic of the program or the PL/SQL block is to be mentioned. This section starts with the keyword “BEGIN” and ends with  with the keyword “END”. This section makes use of terms such as SQL statements, Loops and Conditional Statements.

Note: PL/SQL has tight integration with SQL

Exception Section

The Exception section of a PL/SQL Block is an optional section. This section starts with the keyword “EXCEPTION”. This section is used to handle any errors that occur during program execution. It helps normal termination of an abnormal program.

This was all about the introduction to PL/SQL programming. Let us know if you have any queries in the comment section below.

翻译自: https://www.thecrazyprogrammer.com/2015/05/introduction-to-plsql-programming.html

pl/sql编程

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值