Problem in loop to search values [message #309693] |
Fri, 28 March 2008 08:26  |
asadkhan_2
Messages: 36 Registered: January 2008
|
Member |
|
|
I have a problem the scene is
I have two tables in one i have specified all the parameters against products and tests
in the other table i have all of these columns+ a value column also in which when i call i give values against each parmameter and then i m using a function to calculate against these parameters
but the problem is first i have 12 test and 12 functions for calculations now i will write this code 12 times to search the parameter and the value which user will give for that parameter
is there an easy way to solve this
thanks a lot
DECLARE
V_W1 NUMBER;
V_W2 number;
V_W3 number;
V_W4 number;
V_V number;
res number;
No_Rec number;
BEGIN
go_block('PARAMETER1');
Last_Record;
No_Rec:=:System.Cursor_Record;
First_Record;
FOR I in 1..No_Rec loop
If :parameter1.parameter_id = 'w1' then
V_W1:=:value;
elsif :parameter1.parameter_id = 'w2' then
V_W2:=:value;
elsif :parameter1.parameter_id = 'w3' then
V_W3:=:value;
elsif :parameter1.parameter_id = 'w4' then
V_W4:=:value;
elsif :parameter1.parameter_id = 'V' then
V_V:=:value;
end if;
Next_Record;
End Loop;
first_record;
res:=calcul_particular_matter(V_W1,V_W2,V_W3,V_W4,V_V);
:test:=to_char(res,'999999.0000');
|
|
|
|
|
|