Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

how to create n dimension array 1

Status
Not open for further replies.

danmul

Programmer
Jan 16, 2003
89
IE
Hi,

I can create a 2 dimension array. I tried to create an n dimension array. Is this possible? I did not get an error on creation but got an error when I tried to assign a value. Here is what I tried:

type v_admin_type_record is record(v_index number,
admin_type aps_admin_requirement.admin_type%type);

type v_admin_table is table of v_admin_type_record index by binary_integer;

v_admin v_admin_table;

begin

v_admin_index_table.v_index(1) := 1;
end;

I get the error "v_index must be declared"

Any help will be appreciated.
daniel.
 
Found problem here but now have another
1st problem was v_admin_index_table.v_index(1) := 1;
should have been v_admin_index_table(1).v_index := 1;

Is it possible to define these tables within an oracle forms session so that all program units would have access to it.

Thanks,
Daniel.

 
Yes. You can create a program unit package that contains the definitions as you have decscribed:

Code:
PACKAGE test_package IS

type v_admin_type_record is record(v_index     number,
                                   admin_type  aps_admin_requirement.admin_type%type); 
type v_admin_table is table of v_admin_type_record index by binary_integer;

v_admin     v_admin_table;  

END;

Then you can reference the table you have created anywhere in your current form using syntax like

[tt]test_package.v_admin(1).v_index := 1;[/tt]

Please note I have tested this piece of code in forms 6.0.8.21.3.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top