• logo
  • 9861600203
  • 5555545
  • info@mentorit.com.np
header-logo.png

Overview

PL/SQL or Procedural Language for SQL is an extended version of SQL programming, designed specifically by Oracle for its relational databases, to be programmed alongside SQL and Java. As a programming language, it is derived from SQL and incorporates object-oriented programming (OOPS) concepts such as procedures, functions, loops, conditional statements, etc. Also, this programming language consents to variables & constants declaration, similar to Java and other OOPS-based programming languages.

PL/SQL

  • PL/SQL is an extension of SQL that allows developers to combine the power of SQL with procedural statements. Oracle Corporation developed it in the early ’90s. It allows writing a piece of code, including the SQL query in a block (which is the basic unit of it).
  • It is a high standard and readable language, so it is very easy to understand and learn. It can only be used with Oracle Database Systems and cannot be used as a standalone application like C, C++, Java, etc. It provides the facility to developers to use loops, conditions, object-oriented concepts and SQL like other database languages.
  • Before this, only one query is sent to the Oracle server, which increases the load and time. But through this, multiple SQL statements are grouped and sent in a single block or subprogram, which increases the processing speed and decreases the traffic on Oracle Server.

Why should we use PL/SQL?

  • Although PL/SQL at the end executes and processes the SQL statements but consider a scenario of updating the salary record with the hike of 20% of all employees in the Employee table having 1000+ values, is it practical to write the update command 1000+ times and fire SQL query each time to update the records? For this, it came into the picture as though it looping; it can be done in 2 lines of code without any interruption in between
  • Moreover, it is fundamental for any web application to hide the implementation logic from the end-users. It is done through Interfaces in programming languages like Java, C++. Similarly, the database is the main module in Database intensive applications, and the SQL queries and tables are its implementation data.
  • All these modules are hidden behind the PL/SQL interface. This way, it maintains the correctness, maintainability, security, and abstraction for both the developers and end-users.
  • It provides a special facility to work with the triggers (Triggers are special events that are fired when any specific mentioned situation is met). This deals with various triggers like View level triggers, Database level triggers, Session level Triggers, and Table level triggers.

Advantages of PL/SQL

Below given are some of the advantages:

  • It allows the users/developers to run multiple SQL statements at once by wrapping them in a block.
  • It is compatible with SQL. It allows us to use all the SQL statements, data manipulation, cursor handling, transaction statements in PL/SQL blocks. There is no need for conversion between the two of them.
  • It is easy to maintain the subprogram as only one copy is stored in the database server, which can be accessed by all the clients and applications using it.
  • It supports scalability by the access of centralized processing on database servers, allowing multiple concurrent users to access it on a single node.
  • It supports Portability, as the applications are written in PL/SQL, and are portable to computer Operating systems and hardware where the Oracle database is present and working properly.
  • It provides very easy and expressive syntax, which is very easy to understand if someone is familiar with any programming language.
  • It allows users to define triggers that are fired automatically when a particular situation is met.

Course Content

  • Features of PL/SQL
  • Advantages of PL/SQL
  • Text Editor
  • The ‘Hello World’ Example
  • The PL/SQL Identifiers
  • The PL/SQL Delimiters
  • The PL/SQL Comments
  • PL/SQL Program Units
  • PL/SQL Scalar Data Types and Subtypes
  • PL/SQL Numeric Data Types and Subtypes
  • PL/SQL Character Data Types and Subtypes
  • PL/SQL Boolean Data Types
  • PL/SQL Datetime and Interval Types
  • PL/SQL Large Object (LOB) Data Types
  • PL/SQL User-Defined Subtypes
  • NULLs in PL/SQL
  • Variable Declaration in PL/SQL
  • Initializing Variables in PL/SQL
  • Variable Scope in PL/SQL
  • Assigning SQL Query Results to PL/SQL Variables
  • Declaring a Constant
  • The PL/SQL Literals
  • Arithmetic Operators
  • Relational Operators
  • Comparison Operators
  • Logical Operators
  • PL/SQL Operator Precedence
  • Labeling a PL/SQL Loop
  • The Loop Control Statements
  • Declaring String Variables
  • PL/SQL String Functions and Operators
  • Creating a Varray Type
  • Parts of a PL/SQL Subprogram
  • Creating a Procedure
  • Executing a Standalone Procedure
  • Deleting a Standalone Procedure
  • Parameter Modes in PL/SQL Subprograms
  • Methods for Passing Parameters
  • Creating a Function
  • Calling a Function
  • PL/SQL Recursive Functions
  • Implicit Cursors
  • Explicit Cursors
  • Declaring the Cursor
  • Opening the Cursor
  • Fetching the Cursor
  • Closing the Cursor
  • Table-Based Records
  • Cursor-Based Records
  • User-Defined Records
  • Syntax for Exception Handling
  • Raising Exceptions
  • User-defined Exceptions
  • Pre-defined Exceptions
  • Creating Triggers
  • Triggering a Trigger
  • Package Specification
  • Package Body
  • Using the Package Elements
  • The Package Specification
  • Creating the Package Body
  • Using The Package
  • Index-By Table
  • Nested Tables
  • Collection Methods
  • Collection Exceptions
  • Starting and Ending a Transaction
  • Committing a Transaction
  • Rolling Back Transactions
  • Automatic Transaction Control
  • Field Values for Datetime and Interval Data Types
  • The Datetime Data Types and Functions
  • The Interval Data Types and Functions
  • DBMS_OUTPUT Subprograms
  • Instantiating an Object
  • Member Methods
  • Using Map method
  • Using Order method
  • Inheritance for PL/SQL Objects
  • Abstract Objects in PL/SQL

About the instructor

DIPU MAHARJAN

BI Solution Architect

Hi I am Dipu Maharjan. I am working as BI Solution Architect. I have experience more than 10 years as Data Analyst, Database Programmer, Developer and Trainer.

No reviews for this course


Write a Message

Security Check
2 + 2 =

    Course Features