-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPROCEDURE_NESTED_EMP_LNAME_UPDATE.sql
More file actions
38 lines (35 loc) · 1.15 KB
/
PROCEDURE_NESTED_EMP_LNAME_UPDATE.sql
File metadata and controls
38 lines (35 loc) · 1.15 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
-- PROCEDURE
-- NESTED PROCEDURE: Unnamed bloklarda yazilirlar. Veritabani icinde saklanmazlar.
-- STORED PROCEDURE: Standalone ya da Package icinde yazilabilir. Veritabani icinde saklanir.
-- 101 nolu calisanin adini listeleyen ve sonra sayadini buyuk harflere donusturen Nested Procedure yazalim.
Declare
Procedure emp_name
IS wname employees.first_name%type;
wlname employees.last_name%type;
Begin
Select employees.first_name, employees.last_name into wname, wlname
from employees
where employee_id = 101;
Dbms_Output.put_line('Var Olan: ' || wname || ' ' || wlname);
Exception
when others then
Dbms_output.put_line('Hata oluþtu!');
End emp_name;
Procedure change_lname
IS wname employees.last_name%type;
Begin
Update employees
set last_name = upper(last_name)
where employee_id = 101
returning last_name into wname;
Dbms_Output.put_line('Güncel Soyad: ' || wname);
Exception
when others then
Dbms_output.put_line('Hata oluþtu!');
End change_lname;
Begin
emp_name();
change_lname();
End;
/
rollback;