Home » Developer & Programmer » Forms » how to do a loop on a simple list
how to do a loop on a simple list [message #81696] |
Wed, 12 March 2003 07:39  |
Lionel
Messages: 3 Registered: May 2002
|
Junior Member |
|
|
Hi,
I`m new to pl/sql and I don`t know how to do the following, can you help ?
I`d like to run a :
FOR X in ( variable1,variable2,variable2,variable3) do
begin
....
end;
In pl/sql, can you use hash ? or create array, or array within array ? To call a variable with var_array('country')[[1]] for example ?
Do you have structures like in perl, with hash1( 'country' => array1, 'customer' => array2...) ???
I am writing lots of lines, where the use of a "for X in list" will save time and lines. All I can find in the doc is about using FOR with numerical values...for x in 1..3
Is FORALL the solution ? ( how to use it in my case ? )
What i do now is :
If variable = AA then
if test(AA1)
insert into table1 values ( ...AA1.. )
insert into table2 values ( ...AA1.. )
if test(AA2)
insert into table1 values ( ...AA2..)
insert into table2 values ( ...AA2..)
if test(AA3)
insert into table1 values ( ...AA3..)
insert into table2 values ( ...AA3..)
if test(AA4)
insert into table1 values ( ...AA4..)
insert into table2 values ( ...AA4.. )
end if
if variable = BB then
if test(BB1) ...
...
Thanks for any help -
|
|
|
|
|
Goto Forum:
Current Time: Wed Mar 05 00:26:53 CST 2025
|