Introduction to PL/SQL
来源:互联网 发布:linux安装中文语言包 编辑:程序博客网 时间:2024/05/08 00:17
This PL SQL Programming tutorial
This Oracle PL SQL tutorial teaches you the basics of programming in PL/SQL with appropriate examples. You can use this tutorial as your guide or reference while programming with PL SQL. I will be making this Oracle PL SQL programming tutorial as often as possible to share my knowledge in PL SQL and help you in learning PL SQL better.
Even though the programming concepts discussed in this tutorial is specific to Oracle PL SQL. The concepts like cursors, functions and stored procedures can be used in other database systems like Sybase , Microsoft SQL server etc, with some change in syntax. This tutorial will be growing regularly; let us know if any topic related to PL SQL needs to be added or you can also share your knowledge on PL SQL with us. Lets share our knowledge about PL SQL with others.
Even though the programming concepts discussed in this tutorial is specific to Oracle PL SQL. The concepts like cursors, functions and stored procedures can be used in other database systems like Sybase , Microsoft SQL server etc, with some change in syntax. This tutorial will be growing regularly; let us know if any topic related to PL SQL needs to be added or you can also share your knowledge on PL SQL with us. Lets share our knowledge about PL SQL with others.
A Simple PL/SQL Block:
Each PL/SQL program consists of SQL and PL/SQL statements which from a PL/SQL block.
A PL/SQL Block consists of three sections:
Every statement in the above three sections must end with a semicolon ; . PL/SQL blocks can be nested within other PL/SQL blocks. Comments can be used to document code.
This is how a sample PL/SQL Block looks.
DECLARE
Variable declaration
BEGIN
Program Execution
EXCEPTION
Exception handling
END;
A PL/SQL Block consists of three sections:
- The Declaration section (optional).
- The Execution section (mandatory).
- The Exception (or Error) Handling section (optional).
Declaration Section:
The Declaration section of a PL/SQL Block starts with the reserved keyword DECLARE. This section is optional and is used to declare any placeholders like variables, constants, records and cursors, which are used to manipulate data in the execution section. Placeholders may be any of Variables, Constants and Records, which stores data temporarily. Cursors are also declared in this section.Execution Section:
The Execution section of a PL/SQL Block starts with the reserved keyword BEGIN and ends with END. This is a mandatory section and is the section where the program logic is written to perform any task. The programmatic constructs like loops, conditional statement and SQL statements form the part of execution section.Exception Section:
The Exception section of a PL/SQL Block starts with the reserved keyword EXCEPTION. This section is optional. Any errors in the program can be handled in this section, so that the PL/SQL Blocks terminates gracefully. If the PL/SQL Block contains exceptions that cannot be handled, the Block terminates abruptly with errors.Every statement in the above three sections must end with a semicolon ; . PL/SQL blocks can be nested within other PL/SQL blocks. Comments can be used to document code.
This is how a sample PL/SQL Block looks.
DECLARE
Variable declaration
BEGIN
Program Execution
EXCEPTION
Exception handling
END;
http://plsql-tutorial.com/index.htm
- Introduction to PL/SQL
- VTC Introduction to Oracle9i - SQL & PL/SQL (1Z0-007)
- PLS-1: Introduction to Oracle PL/SQL ended@T8
- Introduction to SQL
- 2.2.1 Introduction to SQL
- Introduction to SQL Server Reporting Services (SSRS)
- Beginning PL/SQL: From Novice to Professional
- How to run workflow using PL/SQL
- Add Responsibility to USER using pl/sql
- Introduction To Role-Based Security In SQL Server Reporting Services
- Introduction to SQL Server 2008 Report Builder 2.0
- SQL SERVER – 2005 – Introduction to Partitioning
- Introduction: Connect to SQL Membership with ASP.NET Application
- An introduction to JSON support in Spark SQL
- ORA-06502 assigning values from SQL to PL/SQL variables
- How to use PL SQL Developer in Ubuntu
- Uses DBMS_DDL.CREATE_WRAPPED to obfuscate PL/SQL source
- ow to install PL/SQL developer on linux
- format:自己写的format函数
- sqlite3 常用操作
- .NET url 的编码与解码
- 实习日记014(0804)
- C语言测试题的讲解分析
- Introduction to PL/SQL
- C# 让程序带参数运行 如:1.exe -a
- 隐式类型转换(C++学习)
- C#读写app.config中的数据
- 变换一种方式
- Windows安装hadoop
- vim 7.3 几项基本操作
- AIX 5.3++HACMP5.4+ORACLE10.2双机热备
- job control的管理