Solved

Filling A list item in oracle forms builder

Posted on 2004-10-06
5
3,185 Views
Last Modified: 2008-01-09
Hi Experts  ..

I have a list item in oracle forms builder 6 and I want ti fill it from a database table. How can I don this with minimux lines of code ??

thanx alot ?
0
Comment
Question by:ehmf
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
5 Comments
 

Author Comment

by:ehmf
ID: 12235716
Hi Experts  ..

I have a list item in oracle forms builder 6 and I want to fill it from a database table. How can I do this with minimux lines of code ??

thanx alot ?
0
 
LVL 27

Expert Comment

by:kretzschmar
ID: 12235895
>How can I do this with minimux lines of code ??
a lazy coder, i guess

well,

define a recordgroup and in the when-new-form-instance-trigger use

populate_list(:block_name.item_name,:recordgroupname);

i'm just a lazy expert

meikl ;-)
0
 
LVL 9

Expert Comment

by:konektor
ID: 12236197
u can read in loop item by item using get_list_element_value and get_list_element_label functions and store data into table ...
0
 
LVL 48

Accepted Solution

by:
schwertner earned 125 total points
ID: 12237591
In the trigger WHEN_NEW_BLOCK-INSTANCE where your list item is defined put the following call

POPULATE_LIST_WITH_QUERY(
'item241',
'SELECT land_text,land_code FROM pepper_land_lookup
WHERE sysdate BETWEEN valid_from AND NVL(valid_to,sysdate+10)');

where item241 is the name of the list item you need to populate and the second argument is the needed querry.

Put the PROCEDURE populate_list_with_query in the program units section of your form

--Populates the given list item with the specified query
PROCEDURE populate_list_with_query
   (p_list_item IN VARCHAR2,
    p_query     IN VARCHAR2)
IS
   /* Name the record group after the list item
    (no block prefix).  */
   cst_rg_name CONSTANT VARCHAR2(30) :=
       GET_ITEM_PROPERTY(p_list_item,item_name);
   v_rg_id RECORDGROUP;
BEGIN
   v_rg_id := FIND_GROUP(cst_rg_name);
   IF ID_NULL(v_rg_id) THEN
      v_rg_id := CREATE_GROUP_FROM_QUERY(cst_rg_name,p_query);
   END IF;
   IF POPULATE_GROUP(v_rg_id) = 0 THEN
      POPULATE_LIST(p_list_item,v_rg_id);
         /* Force display of first list element label
            in the list item. */
      COPY(GET_LIST_ELEMENT_VALUE(p_list_item,1),p_list_item);
   END IF;  
END populate_list_with_query;
0
 
LVL 27

Expert Comment

by:kretzschmar
ID: 12237803
schwertner isn't so lazy than i ;-))
0

Featured Post

Online Training Solution

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action. Forget about retraining and skyrocket knowledge retention rates.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Working with Network Access Control Lists in Oracle 11g (part 1) Part 2: http://www.e-e.com/A_9074.html So, you upgraded to a shiny new 11g database and all of a sudden every program that used UTL_MAIL, UTL_SMTP, UTL_TCP, UTL_HTTP or any oth…
From implementing a password expiration date, to datatype conversions and file export options, these are some useful settings I've found in Jasper Server.
This video shows, step by step, how to configure Oracle Heterogeneous Services via the Generic Gateway Agent in order to make a connection from an Oracle session and access a remote SQL Server database table.
This videos aims to give the viewer a basic demonstration of how a user can query current session information by using the SYS_CONTEXT function

729 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question