Solved

Filling A list item in oracle forms builder

Posted on 2004-10-06
5
3,082 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

On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

Question has a verified solution.

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

I remember the day when someone asked me to create a user for an application developement. The user should be able to create views and materialized views and, so, I used the following syntax: (CODE) This way, I guessed, I would ensure that use…
How to Unravel a Tricky Query Introduction If you browse through the Oracle zones or any of the other database-related zones you'll come across some complicated solutions and sometimes you'll just have to wonder how anyone came up with them.  …
This video explains at a high level about the four available data types in Oracle and how dates can be manipulated by the user to get data into and out of the database.
This video shows setup options and the basic steps and syntax for duplicating (cloning) a database from one instance to another. Examples are given for duplicating to the same machine and to different machines

733 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