Loop within Oracle Forms PL / SQL Block

1

Good day, I have a block with the following elements:

* TextBox *Check box * Label

in the TextBox I execute a query to show me data from a table, the checkboxes will serve me to indicate which of the elements shown I want to execute in a second process through a button that is not in the same block, and Last labels to show values that are not of database, this will be a state depending on the result of executing some functions in the aforementioned button.

The button what it does is to send two functions within a package in the database, in the first I send three parameters and it returns a correlative value that I use to call the second function, this second one I pass as parameters the values of a column that show the textbox, how my problem or inconvenience can vary is the following:

I need to go through each of the elements and check if their respective checkboxes are marked, if so, send the second function for each checkbox marked and pass this value of the first column (CODPROCESO) as parameter, at the end of the process, in the labels show if they were executed correctly or not with a message.

Sample image of the way I work:

    
asked by Edwin Vasquez 03.04.2018 в 21:14
source

1 answer

1

to see if this serves you:

--Vamos al bloque que queremos recorrer y nos situamos en el primer registro
GO_BLOCK('nombre_de_tu_bloque');
FIRST_RECORD;  

WHILE :SYSTEM.LAST_RECORD = 'FALSE' LOOP
--Mientras no hayamos llegado al úlitimo registro

   IF :Nombre_De_Tu_Bloque.Nombre_CheckBox = 'S' THEN
      --Si el campo check está marcado ejecutamos la función
      ejecuta_funcion(con_parametro_que_sea);   
   END IF;

   --Nos movemos al siguiente registro
   NEXT_RECORD;
END LOOP;

This is a simple way to go through a block of a form. The way it works is very similar to how we would do it manually. That is, going to the block we want to go, sitarnos in the first record and from there we go through all the registration making the purchases we want.

    
answered by 17.04.2018 / 17:04
source