Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Package problem
Could someone give me a suggestion as to what might be wrong with the
following code:
SQL> create or replace package GET_NEXT_VRD_PKG
2 AS
3 function next_vrd_number (country_code_in IN varchar2,
type_code_in IN varchar2) return varchar2;
4 pragma restrict_references (next_vrd_number,WNDS);
5 end GET_NEXT_VRD_PKG;
6 /
Package created.
SQL> create or replace package body GET_NEXT_VRD_PKG 2 AS
3 slash constant varchar2(1) := '/'; 4 percent_sign constant varchar2(1) := '%'; 5 first_slash number; 6 second_slash number; 7 total_count number; 8 max_value_work number; 9 max_value_string varchar2(15); 10 max_value_out varchar2(15); 11 cc varchar2(5); 12 tc varchar2(1); 13 cursor c1 is 14 select vrd_number 15 from vrd
20 table of vrd_number_out%type 21 index by binary_integer; 22 i binary_integer := 1;23 vrd_number_array vrd_number_type; 24 function next_vrd_number (country_code_in IN varchar2, type_code_in IN varchar2)
27 max_value_out varchar2(15);28 begin
34 fetch c1 into vrd_number_out; 35 exit when c1%notfound;
41 first_slash := instr(vrd_number_array(total_count),slash,1,1); 42 second_slash := instr(vrd_number_array(total_count),slash,1,2); 43 if second_slash > first_slash then 44 max_value_string := substr(vrd_number_array(total_count),second_slash + 1); 45 max_value_work := to_number(max_value_string + 1); 46 max_value_out := rtrim(upper(cc))||slash||rtrim(upper(tc))||slash||to_char(max_value_work); 47 end if; 48 else 49 max_value_out :=
53 when NO_DATA_FOUND THEN 54 RAISE_APPLICATION_ERROR (-20100, 'COUNTRY CODE/VRD TYPE CODENOT in database.');
Package body created.
SQL> execute get_next_vrd_pkg.next_vrd_number('us','a') begin get_next_vrd_pkg.next_vrd_number('us','a'); end;
*
ERROR at line 1:
ORA-06550: line 1, column 7: PLS-00221: 'NEXT_VRD_NUMBER' is not a procedure or is undefined ORA-06550: line 1, column 7:
SQL> commit;
Commit complete.
SQL> execute get_next_vrd_pkg.next_vrd_number('us','a') begin get_next_vrd_pkg.next_vrd_number('us','a'); end;
*
ERROR at line 1:
ORA-06550: line 1, column 7: PLS-00221: 'NEXT_VRD_NUMBER' is not a procedure or is undefined ORA-06550: line 1, column 7:
If I do a select * from user_source where name = 'GET_NEXT_VRD_PKG' the package does exist but it seems as though none of the functions are available. If I do a select * from user_errors where name = 'GET_NEXT_VRD_PKG' it shows no errors. I am using Oracle version 7.3.2 on a Sequent box using Dynix (there version of Unix). This one has go me stumped.
I'd like to give thanks in advance for any help I can get on this.
Yours Truly,
Rob Thompson
DBA
Ford Motor Company
work: rthomp41_at_ford.com
home: rthom40065_at_aol.com
Received on Tue Jan 12 1999 - 14:44:39 CST
![]() |
![]() |