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
| CREATE OR replace package pack1 IS aa int:=9; PROCEDURE insert_student(a1 IN student%rowtype); PROCEDURE update_student(a2 IN student%rowtype); END pack1;
CREATE OR replace package body pack1 IS bb int:=5; PROCEDURE insert_student(a1 IN student%rowtype) IS BEGIN INSERT INTO student(sno,sname,sage) VALUES (a1.sno,a1.sname,a1.sage); COMMIT; dbms_output.put_line(pack1.bb); END insert_student; PROCEDURE update_student(a2 IN student%rowtype) IS BEGIN UPDATE student SET sname=a2.sname WHERE sno=a2.sno; COMMIT; END update_student; END pack1;
EXEC dbms_output.put_line(pack1.aa);
EXEC dbms_output.put_line(pack1.bb);
|