Adsense Ad

Monday 12 February 2018

Oracle Forms: Progress Bar Solution - 1

Here is a way to implement a Progress Bar using ORACLE FORMS.
------------------------------------------------------------------
-- Block5.Item8 is a white empty text item
-- Block5.Item9 is a blue empty text item that grows over Block5.Item8.
-- c1 is a cursor.  This piece of code has to perform a given action
-- (PROCESS) for every cursor's record.
DECLARE
   record_count         INTEGER;
   total_number_record  INTEGER;
   CURSOR c1 IS SELECT... ; --
   c1_rec  c1%ROWTYPE;
BEGIN
   OPEN c1;
   FETCH c1 INTO c1_rec;
   total_number_record := SELECT COUNT(*) FROM ...; --same table then
the cursor.
   WHILE c1%FOUND LOOP
      PROCESS(c1_rec);  -- The action to monitor;
      record_count := record_count + 1;
      set_item_property('Item9',width, 200 * record_count /
total_number_record );
        synchronize;
      FETCH C1 INTO c1_rec;
   END LOOP ;
END;
------------------------------------------------------------------

No comments: