[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

Filling A list item in oracle forms builder

Posted on 2004-10-06
5
Medium Priority
?
3,413 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 250 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

Efficient way to get backups off site to Azure

This user guide provides instructions on how to deploy and configure both a StoneFly Scale Out NAS Enterprise Cloud Drive virtual machine and Veeam Cloud Connect in the Microsoft Azure Cloud.

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…
Introduction A previously published article on Experts Exchange ("Joins in Oracle", http://www.experts-exchange.com/Database/Oracle/A_8249-Joins-in-Oracle.html) makes a statement about "Oracle proprietary" joins and mixes the join syntax with gen…
This video shows how to set up a shell script to accept a positional parameter when called, pass that to a SQL script, accept the output from the statement back and then manipulate it in the Shell.
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

656 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