Home » Developer & Programmer » Forms » using array.
using array. [message #116684] Thu, 21 April 2005 06:47 Go to next message
zigbinputi
Messages: 11
Registered: April 2005
Junior Member
hi,

i want to use array in forms6i, stores my details & retrieve it later.. how can i do it? is the example below ok?

my_data(100) varchar2(200);
my_number(100) number;

begin
for i in 1..100
loop
my_data(i) := 'value';
my_number(i) := i;
end loop;
end;


pls.. help how to use array..
Re: using array. [message #116761 is a reply to message #116684] Thu, 21 April 2005 20:11 Go to previous messageGo to next message
djmartin
Messages: 10181
Registered: March 2005
Location: Surges Bay TAS Australia
Senior Member
Account Moderator
Put the array into a database package so that it is available to the rest of your session.
Re: using array. [message #116825 is a reply to message #116761] Fri, 22 April 2005 07:56 Go to previous messageGo to next message
zigbinputi
Messages: 11
Registered: April 2005
Junior Member
how? any sample?
Re: using array. [message #117222 is a reply to message #116684] Mon, 25 April 2005 19:02 Go to previous message
djmartin
Messages: 10181
Registered: March 2005
Location: Surges Bay TAS Australia
Senior Member
Account Moderator
Create a package 'my_pkg'.

CREATE OR REPLACE PACKAGE my_pkg is
type tokens is table of varchar2(500) index by binary_integer;
END my_pkg;
CREATE OR REPLACE PACKAGE BODY my_pkg
IS
END my_pkg;
[You will probably have to create a 'dummy' procedure or function to get the load of the package to work.]

Then store your values as:
my_pkg.tokens(1) := value;

Try it and see how you go.

David
Previous Topic: Run time popup menus
Next Topic: Cumulative total
Goto Forum:
  


Current Time: Thu Sep 19 18:44:57 CDT 2024