Solved

Filling A list item in oracle forms builder

Posted on 2004-10-06
5
2,941 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
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 47

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

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Join & Write a Comment

Subquery in Oracle: Sub queries are one of advance queries in oracle. Types of advance queries: •      Sub Queries •      Hierarchical Queries •      Set Operators Sub queries are know as the query called from another query or another subquery. It can …
Cursors in Oracle: A cursor is used to process individual rows returned by database system for a query. In oracle every SQL statement executed by the oracle server has a private area. This area contains information about the SQL statement and the…
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
This video explains what a user managed backup is and shows how to take one, providing a couple of simple example scripts.

744 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

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now