Home » Developer & Programmer » Forms » List Item make query  () 1 Vote
List Item make query [message #191227] Tue, 05 September 2006 04:57 Go to next message
emadbsb
Messages: 334
Registered: May 2005
Location: egypt
Senior Member

Hii all

i have used a "list item" in my form
and i want its item to be read from a query created according to a table instead of putting the elements as constants

can i make this


Thanks for everyone Helped and helping me

[Updated on: Tue, 05 September 2006 04:59]

Report message to a moderator

Re: List Item make query [message #191330 is a reply to message #191227] Tue, 05 September 2006 14:58 Go to previous message
RJ.Zijlstra
Messages: 104
Registered: December 2005
Location: Netherlands - IJmuiden
Senior Member
Hi,

I developed this general procedure for list-items. If you like it, place it in a library and use it:

PROCEDURE Maak_Lijst( P_ItemNaam Varchar2, P_SqlString varchar2) IS 
/* generate a TList for item with name P_ItemNaam: 
    properties of the item MUST be: 
    a) Required =>  'No' 
    b) double click 'elements in list' and place a dummy value in 'List Item Value'
    c) item - type     = listitem 
    d) item - liststyle = Combo Box 
 */ 
  list_id     ITEM; 
  rg_id       RecordGroup; 
  rg_naam Varchar2(40) := 'RG' || to_char(abs(dbms_random.random)) /* generate a comletely random name*/; 
  errcode   Number; 
BEGIN 
  rg_id := Find_Group( rg_naam); 
  -- 
  if id_Null(rg_id) then 
    rg_id := Create_Group_From_Query( rg_naam, P_SqlString); 
  end if; 
  -- 
 errcode := Populate_Group(rg_id); 
 -- 
 Populate_List( P_ItemNaam ,rg_id); 
exception 
  when others then 
    -- handle your error here
END;

examples:
  maak_lijst( 'detail.brandstof',
  	      'select soort soort_1, soort from au_brandstof');
  --
  maak_lijst( 'detail.station',
              'SELECT btk,
                      to_char(id)
		 FROM rel
		WHERE relsrt_id = 10
		order by btk' );

  --
  maak_lijst( 'detail.auto',
              'select merk || '', '' || type,
                      to_char(id)
                 from au_autos');      
  --
  maak_lijst( 'detail.kbg',
              'select ''Kas'', ''K'' from dual' );
  --
  maak_lijst( 'au_tanken.br_merk_id',
              'select btk naam, 
                      btk key
                 from au_brandstof_merk
                order by naam'); 

HTH,

Regards

Rob Zijlstra

[Updated on: Sun, 10 September 2006 22:57] by Moderator

Report message to a moderator

Previous Topic: Data Block Property
Next Topic: Oracle Certification - Forms
Goto Forum:
  


Current Time: Sun Dec 04 16:41:07 CST 2016

Total time taken to generate the page: 0.56309 seconds