1、語法
2、實例:
2、實例:
1
create or replace package mypack as
2
procedure update_deptment
3
(
4
v_dno in dept.depno%type,
5
v_name in dept.dname%type
6
);
7
8
procedure find_deptment
9
(
10
v_dno1 in dept.depno%type
11
);
12
end;
13
/

2

3

4

5

6

7

8

9

10

11

12

13

1
create or replace package body mypack as
2
3
procedure update_deptment
4
(
5
v_dno in dept.depno%type,
6
v_name in dept.dname%type
7
) is
8
begin
9
update dept
10
set dname = v_name
11
where depno = v_dno;
12
dbms_output.put_line('update success');
13
end;
14
15
procedure find_deptment
16
(
17
v_dno1 in dept.depno%type
18
) is
19
va_name dept.dname%type;
20
begin
21
select dname into va_name from dept where depno = v_dno1;
22
dbms_output.put_line('name:' || va_name);
23
end;
24
25
end;

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

19

20

21

22

23

24

25
