-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPROCEDURE_STORED_EXP.sql
More file actions
33 lines (31 loc) · 1.11 KB
/
PROCEDURE_STORED_EXP.sql
File metadata and controls
33 lines (31 loc) · 1.11 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
-- STANDALONE STORED PROCEDURE
-- Departments tablosuna haftasonlari kayit girisini engelleyen bir Procedure yazalim.
CREATE OR REPLACE PROCEDURE proc_ins_dept (
d_id in departments.department_id%type,
d_name in departments.department_name%type, -- default 145,
d_mng_id in departments.manager_id%type,
d_lctn_id in departments.location_id%type,
d_result out varchar2
)IS
Begin
Begin
IF TO_CHAR(sysdate, 'DAY') IN ('CUMARTESI', 'PAZAR') THEN
d_result := 'PAZAR ve PAZARTSÝ KAYIT GÝRÝLEMEZ!';
ELSE
INSERT INTO departments VALUES (d_id, d_name, d_mng_id, d_lctn_id);
d_result := 'KAYIT ISLEMI BASARILI.';
commit;
END IF;
Exception when others then
d_result := sqlcode || ' ' || sqlerrm;
End;
END proc_ins_dept;
/
DECLARE
wresult varchar2(3000);
BEGIN
proc_ins_dept(d_id => 310, d_name => 'SCHOOL', d_mng_id => null, d_lctn_id => 1700, d_result => wresult);
dbms_output.put_line(wresult);
END;
/
DROP PROCEDURE proc_ins_dept;