9 Replies Latest reply: Nov 4, 2013 2:36 AM by 979801 RSS

    problem with List Item in oracle forms

    979801

      Hello Experts,        

                           I am new in oracle forms and i am using oracle forms 11g with weblogic 10.3.5 at windows 7.

      I have 3 database tables say(tbl_city,tbl_state,tbl_address).

      tbl_city

      C_IDC_nameS_ID
      0None0
      1XYZ1
      2AS2
      3AXD2

        tbl_state

      IDs_IDS_Name
      0None
      1XY
      2ASD

      tbl_address

      A_IDA_StreetS_IDC_ID
      1ABC11

      Now I have made an oracle form having data block tbl_address with base table name tbl_address. In the form there are two list: one(list_state) for State_Name & State_ID and another(list_city) for City Name & C_ID display.

      Here I want when I set State_name to ASD then List item list_city should be populated with the values having State_NAME=ASD not of State_Name=XY or None.I have tried it to make but not succeeded.I have made a procedure to populate list_city list item as:

      -- here item_nm-->List item Name,  sel_val & sel_val2 for selecting C_ID and C_NAME,   tablNm---->tbl_CITY,  whr for where condition,   mtch--->selected value of list_State(list item in form)

      PROCEDURE list_item(block_nm varchar2,item_nm varchar2,sel_val varchar2,sel_val2 varchar2,tablNm varchar2,whr varchar2,mtch varchar2) IS

      group_id RecordGroup;

      group_name varchar2(10) :='abc';

      status NUMBER;

      query1 varchar2(350);

      item_name varchar2(20);

      match varchar2(50);

      BEGIN

          match:=mtch;

          item_name:=block_nm||'.'||item_nm;

        group_id := find_group(group_name);

      if not id_null(group_id) then

      delete_group(group_id);

      end if;

      --if whr='' then

      --    match:='0';

      --    end if;

      query1:='select '|| sel_val || ',TO_CHAR('|| sel_val2 || ') from '|| tablNm ||' where '||whr||' = '||mtch;

      message(query1);

      group_id := Create_Group_From_Query(group_name,query1);

      /* Select statement must have two column*/

      status := Populate_Group(group_id);

      Populate_List(item_name,group_id);

      exception

          when others then

          message('error');

      END;

      I am not  able to guess what trigger  in oracle forms should be used to populate list item(list_city). Please help by giving useful suggestion.

      Thank You

      regards

      aaditya