Monday, 7 July 2014

undefined undefined





Introduction to PL/SQL






What is PL/SQL?
PL/SQL stands for Procedural Language extension of SQL.

PL/SQL is a combination of SQL along with the procedural features of programming languages.

It was developed by Oracle Corporation in the early 90’s to enhance the capabilities of SQL.


The PL/SQL Engine:

Oracle uses a PL/SQL engine to processes the PL/SQL statements. A PL/SQL code can be stored in the client system (client-side) or in the database (server-side).

About This PL SQL Programming Tutorial
This Oracle PL SQL tutorial teaches you the basics of database programming in PL/SQL with appropriate PL/SQL tutorials with examples. You can use these free online tutorials as your guide to practice, learn, for training, or reference while programming with PL SQL. I will be making more Oracle PL SQL programming tutorials 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 are 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 SQL syntax. This PL/SQL 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.

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.

How a Sample PL/SQL Block Looks

DECLARE 
     Variable declaration
BEGIN 
     Program Execution 
EXCEPTION 
     Exception handling
END;

Related Posts:

  • SQL Functions(ddl,dml,dcl & tcl) with Examples There are 4 types of sql functions 1.DML 2.DDL 3.DCL 4.TCL Now lets see one by one 1.DML DML is abbreviation of Data Manipulation Language. It is used to retrieve, store, modify, delete, insert and update data in databa… Read More
  • Oracle Master-Details forms for beginners Creating a Master/Detail FormIn this section, the basic steps for creating a Master/Detail form are introduced. A Master/Detail form is a form that has two blocks arranged in a master/detail relationship.The Master/Detail … Read More
  • MDI Form in Oracle Forms Maximize For Example:- In the Form module 1 trigger Create New trigger WHEN-NEW-FORM-INSTANCE Begin set_window_property('window1', window_state, maximize); SET_WINDOW_PROPERTY(FORMS_MDI_WINDOW, … Read More
  • Oracle report for beginners Create a report using wizard in Report Builder.Open Report BuilderThis is the first screen you will see. Select the first option “Use the Report Wizard” and click OK.Click NextEnter Report Title: erpschools_sample_report and… Read More
  • How to attach a Menu to a oracle form Here are the following steps to attach Menu to a oracle forms: 1. I create a form named as form1. i save it to c:\form1. A file name form1.fmb created at c drive. 2. now i run the form from within form builder a file gener… Read More

0 comments:

Post a Comment

Copyright © 2025 ORACLE-FORU - SQL, PL/SQL and ORACLE D2K(FORMS AND REPORTS) collections | Powered by Blogger
Design by N.Design Studio | Blogger Theme by NewBloggerThemes.com