Download as pdf or txt
Download as pdf or txt
You are on page 1of 10

Overview of PL/SQL

Prepared By :Khaled AlKhudari www.maxvlearn.com 1


Belong to oracle

Prepared By :Khaled AlKhudari www.maxvlearn.com 2


Why to use PL/SQL ?
Example: Updating salary according to department number

Dept 10  raise $100


Dept 20  raise $150
Dept 30  raise $200
Dept 40  raise $240

In SQL In PL/SQL
You will do multiple SQL statements You can write procedure to do this
Update emp
Set sal=sal+100 Create procedure update_sal
Where dept_id=10; ( p_dept_id number , p_amount number )
Is
Update emp Begin
Set sal=sal+150 ……….
Where dept_id=20; …….
…… …….
….. End;

Prepared By :Khaled AlKhudari www.maxvlearn.com 3


Prepared By :Khaled AlKhudari www.maxvlearn.com 4
Prepared By :Khaled AlKhudari www.maxvlearn.com 5
what to do

how to do it

(You can create procedure, function, packages …)


(oracle forms, oracle reports …)
PL/SQL programs can run anywhere an Oracle server runs

Prepared By :Khaled AlKhudari www.maxvlearn.com 6


Prepared By :Khaled AlKhudari www.maxvlearn.com 7
Subprograms

Prepared By :Khaled AlKhudari www.maxvlearn.com 8


Subprograms

Prepared By :Khaled AlKhudari www.maxvlearn.com 9


Thank You

Prepared By :Khaled AlKhudari 10

You might also like