I am trying to work with a custom record type and collections.
create or replace procedure coll_test
as
type param_rec is record (
param_cd varchar2(10),
unit_cd varchar2(10),
min_value number,
max_value number);
type param_array is table of param_rec index by binary_integer;
basic_params param_array;
begin
-- load the array
basic_params(1) := ('00040','43',null,25);
basic_params(2) := ('00400','12',6,9);
basic_params(3) := ('01264','28',null,115);
basic_params(4) := ('00550','19',null,15);
basic_params(5) := ('01256','28',null,20);
-- loop through the array
for i in 1..basic_params.count
loop
dbms_output.put_line(basic_params(i).param_cd||' '||basic_params(i).max_value);
end loop;
end;
/
When I try to compile this, I get the following error message:
11/3
PL/SQL: Statement ignored
11/22
PLS-00320: the declaration of the type of this expression is incomplete or malformed
12/3
PL/SQL: Statement ignored
12/22
PLS-00320: the declaration of the type of this expression is incomplete or malformed
13/3
PL/SQL: Statement ignored
13/22
PLS-00320: the declaration of the type of this expression is incomplete or malformed
14/3
PL/SQL: Statement ignored
14/22
PLS-00320: the declaration of the type of this expression is incomplete or malformed
15/3
PL/SQL: Statement ignored
15/22
PLS-00320: the declaration of the type of this expression is incomplete or malformed
So it appears that I am trying to populate the array incorrectly. Can someone point out what I am doing wrong?
Tony