- 论坛徽章:
- 0
|
QL> create or replace procedure sp_fvt30(t1 IN OUT fvt_test_array,t2 IN OUT fvt_test_array,t3 IN OUT fvt_test_array)
2 as
3 type cur_salary is ref cursor;
4 tsalary cur_salary;
5 c1 fvt_test%ROWTYPE;
6 c2 fvt_test2%ROWTYPE;
7 c3 fvt_test3%ROWTYPE;
8 cnt NUMBER DEFAULT 1;
9 BEGIN
10 open tsalary for select * from fvt_test;
11 while tsalary%found
12 loop
13 fetch tsalary into c1;
14 t1(cnt):=c1.name;
15 t1(cnt+1):=c1.address;
16 t1(cnt+2):=c1.badgeid;
17 t1(cnt+3):=c1.birthday;
18 cnt:=cnt+4;
19 END loop;
20 close tsalary;
21 cnt:=1;
22 open tsalary for select * from fvt_test2;
23 while tsalary%found
24 loop
25 fetch tsalary into c2;
26 t2(cnt):=c2.badgeid;
27 t2(cnt+1):=c2.id;
28 t2(cnt+2):=c2.job;
29 t2(cnt+3):=c2.years;
30 t2(cnt+4):=c2.salary;
31 cnt:=cnt+5;
32 END loop;
33 close tsalary;
34 cnt:=1;
35 open tsalary for select * from fvt_test3;
36 while tsalary%found
37 loop
38 fetch tsalary into c3;
39 t3(cnt):=c3.id;
40 t3(cnt+1):=c3.phone;
41 t3(cnt+2):=c3.sex;
42 t3(cnt+3):=c3.company;
cnt:=cnt+4;
43 END loop;
44 close tsalary;
45 END sp_fvt30;
46 /
Procedure created.
调用如下
SQL> declare
2 t1 fvt_test_array;
3 t2 fvt_test_array;
4 t3 fvt_test_array;
5 BEGIN
6 sp_fvt30(t1(100),t2(100),t3(100));
7 END;
8 /
错误如下
ERROR at line 6:
ORA-06550: line 6, column 1:
PLS-00306: wrong number or types of arguments in call to 'SP_FVT30'
ORA-06550: line 6, column 1:
PLS-00306: wrong number or types of arguments in call to 'SP_FVT30'
ORA-06550: line 6, column 1:
PLS-00306: wrong number or types of arguments in call to 'SP_FVT30'
ORA-06550: line 6, column 1:
PL/SQL: Statement ignored
目的是:调用存储过程sp_fvt30,并且输出out数组参数t1,t2,t3中的内容。也就是输出多结果集看到三个表中的select结果。
上面报我错误不知道如何解决?
[ 本帖最后由 fuxc_666 于 2008-9-1 15:15 编辑 ] |
|