-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCURSOR_IMPLICIT_EXP.sql
More file actions
46 lines (39 loc) · 1.13 KB
/
CURSOR_IMPLICIT_EXP.sql
File metadata and controls
46 lines (39 loc) · 1.13 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
39
40
41
42
43
44
45
46
-- CURSOR
-- IMPLICIT CURSOR: ROWCOUNT, NOTFOUND, FOUND
-- EXPLICIT CURSOR: DEVELOPER DEFINED CURSOR
DECLARE
wname employees2%rowtype;
BEGIN
update employees2 set salary = salary * 1.20 where department_id > 90;
if sql%notfound then
dbms_output.put_line('GUNCELLEME BASARISIZ.');
else
dbms_output.put_line(sql%rowcount || ' KISI GUNCELLENDI.');
end if;
if sql%found then
dbms_output.put_line(sql%rowcount || ' KISI GUNCELLENDI. (2)');
else
dbms_output.put_line('GUNCELLEME BASARISIZ. (2)');
end if;
delete from employees2 where department_id in (100, 110);
/*
if sql%rowcount <> 0 then
dbms_output.put_line(sql%rowcount || ' KISI SILINDI.');
else
dbms_output.put_line('SILME BASARISIZ. (2)');
end if;
*/
if sql%notfound then
dbms_output.put_line('SILME BASARISIZ.');
else
dbms_output.put_line(sql%rowcount || ' KISI SILINDI.');
end if;
if sql%found then
dbms_output.put_line(sql%rowcount || ' KISI SILINDI. (2)');
else
dbms_output.put_line('SILME BASARISIZ. (2)');
end if;
exception when others then
dbms_output.put_line(sqlcode || ' ' || sqlerrm);
END;
/