Solved

Filling A list item in oracle forms builder

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

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
PL/SQL Search for multiple strings 5 59
Export table into csv file in oracle 10 92
Use of Exception to end a Loop 3 33
SQL2016 to ORACLE11G linked-server 6 15
This article started out as an Experts-Exchange question, which then grew into a quick tip to go along with an IOUG presentation for the Collaborate confernce and then later grew again into a full blown article with expanded functionality and legacy…
Checking the Alert Log in AWS RDS Oracle can be a pain through their user interface.  I made a script to download the Alert Log, look for errors, and email me the trace files.  In this article I'll describe what I did and share my script.
Via a live example, show how to restore a database from backup after a simulated disk failure using RMAN.
This video explains what a user managed backup is and shows how to take one, providing a couple of simple example scripts.

803 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