Home » Developer & Programmer » Forms » name of coumns & no. of columns
name of coumns & no. of columns [message #85276] Sun, 13 June 2004 21:07
jhsharma
Messages: 58
Registered: June 2004
Member
I have a detail table I fetched the records in pl/sql table as shown below

DECLARE
   TYPE EmpTabTyp IS TABLE OF lab_mesh_results%ROWTYPE
      INDEX BY BINARY_INTEGER;
   emp_tab EmpTabTyp;
   i BINARY_INTEGER := 0;
   CURSOR c1 IS SELECT * FROM lab_mesh_results
                         where :lab_main_serial = lab_mesh_serial and :lab_main_serial_sub=lab_mesh_serial_sub;

BEGIN
   OPEN c1;
   LOOP
      i := i + 1;
      /* Fetch entire row into record stored by ith element. */
      FETCH c1 INTO emp_tab(i);
      EXIT WHEN c1%NOTFOUND;

        -- process data record
   END LOOP;
   CLOSE c1;
  for i in 1..emp_tab.last loop
        if emp_tab(i).lab_mesh_plus = :a1 and emp_tab(i).lab_mesh_type=:b1 then
        :mesh1 :=emp_tab(i).lab_mesh_mesh;
      end if;
        if emp_tab(i).lab_mesh_plus = :a2 and emp_tab(i).lab_mesh_type=:b2 then
        :mesh2 :=emp_tab(i).lab_mesh_mesh;
      end if;
        if emp_tab(i).lab_mesh_plus = :a3 and emp_tab(i).lab_mesh_type=:b3 then
        :mesh3 :=emp_tab(i).lab_mesh_mesh;
      end if;
       if emp_tab(i).lab_mesh_plus = :a4 and emp_tab(i).lab_mesh_type=:b4 then
            :mesh4 :=emp_tab(i).lab_mesh_mesh;
      end if;
  end loop;

END;

In the above example i do not know the no. of row returned. I want to make form to display the above items in a row. similarly i have to fetch rows from another querry on the same pattern.say viz item1,item2,item3,item4.... 

How can i make mesh1,mesh2,mesh3,mesh4,item1,item2,item3 the dynamically so that it will display them on the form in a row like

example 1 : form should look like as

mesh1 mesh2 mesh3 mesh4 item1 item2 item3 item4

example 2 - the same should look like as on making the querry on other

mesh1 mesh2 mesh3 item1 item2 item3

can any body will help me

using oracle 8 with d2k forms 5

thanks

 
Previous Topic: text color
Next Topic: re : Create item in form dynamically
Goto Forum:
  


Current Time: Tue May 07 09:42:29 CDT 2024