Dynamic creation of record group

Hi
Can anyone suggest me with an example about how to create a dynamic record group and attach it to a lov ?
Regards

Hi,
Thanks for your reply
DECLARE
rg_name VARCHAR2(40) := 'COMPANY_RANGE';
rg_id RecordGroup;
errcode NUMBER;
lov_id LOV;
BEGIN
:System.Message_Level := 0;
rg_id := Find_Group( rg_name );
IF Id_Null(rg_id) THEN
rg_id := Create_Group_From_Query( rg_name||'_TMP', 'select COMPANIES_ID from SYSMODULE.COMPANIES where 1=2');
Set_LOV_Property(lov_id,GROUP_NAME,rg_name||'_TMP');
rg_id := Create_Group_From_Query( rg_name, 'select COMPANIES_ID from SYSMODULE.COMPANIES');
IF Id_Null(rg_id) THEN
Message(' Create group failed');
Message(' ',no_acknowledge);
Raise Form_trigger_failure;
End if;
END IF;
errcode := Populate_Group( rg_id );
lov_id := Find_LOV('LOV7');
Set_LOV_Property(lov_id,GROUP_NAME,rg_name);
END;
The above code, I have placed in when new form instance .. still the same error
when new block instance --- same error
in push button --- same error
FRM-30048: Unable to find record group .
LOV LOV7
Form: DYNAMIC_LOV_CREATION
FRM-30085: Unable to adjust form for output.
Where i am going wrong ..
Regards

Similar Messages

  • Dynamically  populate  a  record  group  on  the  fly uisng LOV

    Hi,
    I want to create dynamically populate a record group on the fly uisng LOV.
    1. This is how the RG_BANKNAME Record Group object look like
    Object : Record Group
    Name : RG_BANKNAME
    Record Group Query : SELECT NAME, SHORT_NAME FROM C_BANKS
    2. I create the Push Button and when user click it will popup the LOV.
    DECLARE
         rg_id RecordGroup;
         errcode NUMBER;
         status BOOLEAN;
    BEGIN
         rg_id := Find_Group('RG_BANKNAME');
         IF Id_Null(rg_id) THEN
              Message('No such group: ',ACKNOWLEDGE);
              RAISE Form_Trigger_Failure;
         ELSE
              errcode :=POPULATE_GROUP(rg_id);     
              SET_LOV_PROPERTY('LV_NAME', TITLE, 'My Own LOV');
              SET_LOV_PROPERTY('LV_NAME', GROUP_NAME, rg_id);
              SET_LOV_COLUMN_PROPERTY('LV_NAME', 1 ,Title, 'NAME');
              SET_LOV_COLUMN_PROPERTY('LV_NAME', 1 ,Width, 150);     
              SET_LOV_COLUMN_PROPERTY('LV_NAME', 2 ,Title, 'SHORT NAME');
              SET_LOV_COLUMN_PROPERTY('LV_NAME', 2 ,Width, 100);     
              status := Show_LOV('LV_NAME',10,20);
              IF NOT status THEN
                   Message('You have not selected a value.');
                   Bell;
              END IF;
         END IF;
    END;
    My question is do I need to create the LOV Object name call 'LV_NAME'? since I don't have this
    create on my design times, because I thought it can be done dynamically on the fly.
    The problem is compliant that the Lov Id is not valid.
    Thanks
    David
    Edited by: user445990 on May 24, 2011 9:19 PM

    Hello,
    You request is not clear. Do you need to display the LOV or not ? In other words, what is the goal of your record group ?
    Francois

  • Creation of Record Group and LOV at run time

    Hello All,
    I have been stuck by this...I have two text items on which LOVs have been placed.Selection of one depends on selection of other.I can dynamically create a record group but how to create a LOV dynamically to populate it with the dynamic record group been created.
    For more visualization consider that filtering of data takes place in one lOV based on the other LOV been provided.
    Revert ASAP...
    Thanks and Regards,
    Kapil Uppal

    I don't think you can create a LOV dynamically, but you can repopulate a pre-existing one, which should allow you to achieve the same goal.

  • Dynamically creating a Record Group based on Previously entered Record Grou

    Forms [32 Bit] Version 10.1.2.3.0 (Production)
    Hi,
    I know how to dynamically create a record group based on a query and putting the code in When new form instance.
    My query is. I have a form which has multiple Record Groups and the user wants to dynamically create subsequent groups based on previous groups.
    For example
    I have a record group with selects a Location,
    when the user selects the Location from a list of values
    the 2nd record group called 'Cost Centres' will have to filter out only those with the locations selected above.
    How can I populate the 2nd record group at run-time when I do not know what site the user will select?
    If I simply populate in when new form instance as in location and just select everything, the list of values populates.
    CC field is a LIST ITEM and the list style is a POP LIST, it is not required.
    I have put the code in the Location field in the when-list-changed trigger.
    I am getting this error:
    frm-41337: cannot populate the list from the record group
    here is the code:
    DECLARE
    v_recsql Varchar2(1000); -- The SQL for creating the Record Group.
    v_recgrp RecordGroup; -- Record Group
    v_status Number; -- Return Value of Populate_Group function.
    c_where VARCHAR2(1000);
    BEGIN
         IF :location = '1' THEN
              c_where := ' substr(cost_centre,1,2) in (''01'',''02'')';
         ELSIF :location  = '2' THEN
              c_where := ' substr(cost_centre,1,2) in (''02'',''03'')';
         ELSIF :location   = '3' THEN
              c_where := ' substr(cost_centre,1,2) in (''01'',''11'',''07'')';
                   ELSE
              c_where :=  ' 1=1'; --EVERYTHING
         END IF;
    v_recsql := 'SELECT cost_centre, description  FROM   cost_centres  where '||c_where;
    -- Create the Record Group
    v_recgrp := CREATE_GROUP_FROM_QUERY('v_recgrp', v_recsql);
    IF NOT ID_NULL(v_recgrp)
    THEN -- No Error, record group has been successfully created.
    -- Populate Record Group
    v_status := POPULATE_GROUP('v_recgrp');
    IF v_status = 0
    THEN -- No Error. Record Group has been Populated.
    POPULATE_LIST('block.CC', 'v_recgrp');
    END IF; -- IF v_status = 0
    -- Delete the Record Group as it is no longer needed.
    DELETE_GROUP('v_recgrp');
    END IF; -- IF NOT ID_NULL(v_recgrp)
    END;thanks for your assistance.

    Hi,
    Once record status gets change for block you can not populate/repopulate the list item. Keep those list items as non-database item with different names and create different items as database orignal items. Than assign the values in WHEN-LIST-CHANGE trigger to the actual database items.
    -Ammad

  • Dynamic record group

    Please explain me step by step to create dynamic record group and populate it into my combo box.
    thanks
    rupal
    Edited by: rupearlkaushal on Jun 13, 2012 9:39 PM

    hi
    plz check out the following threads.
    Dynamic creation of record group
    and
    Dynamic Record Group
    LOV (List of Values)
    LOV is nothing but a form item which is used to provide list of values to a text field.
    Each LOV contains a Record Group which provides the data to the LOV
    Record Group
    A record groups contains the query which is used to populate the values to the LOV.
    To alter a list of values(LOV) of a text field, we should change the query of the
    record group which is attached to the corresponding LOV or we should create a
    new record group and attach it to the existing LOV.
    Note : We cant create a new LOV. But we can attach a exsiting LOV to a form field.Method 1: Changing the query of the existing Record group
    declare
    rg_id RECORDGROUP ;
    err number;
    lv_id lov;
    begin
    rg_id:=find_group('LOV4'); -- LOV4 is the name of the existing LOV
    if not id_null(rg_id) then
    err:=populate_group_with_query(rg_id,
             'select deptno from dept where dname=''SALES''');
    end if;
    lv_id:=find_lov('LOV4');
    set_lov_property(lv_id,group_name,rg_id);Method 2: Creating a new Record Group if doesn't exists
    declare
    rg_id recordgroup;
    pg_num number;
    lv_id lov;
    begin
    rg_id:=find_group('MYGROUP');  -- MYGROUP is the Group Name
    if id_null(rg_id) then
    rg_id:=create_group_from_query('MYGROUP','SELECT 100 deptno FROM dual');
    end if;
    pg_num:=populate_group(rg_id);
    lv_id:=find_lov('LOV4');sarah
    Edited by: Sarah on Jun 13, 2012 9:56 PM

  • Can we change the Record Group Type through Custom.pll

    Hello All,
    I have a small requirement on Changing the Record Group Dynamically.
    Can i set the Record group type to 'Query' from 'Static'. i.e Can i change the Record group type dynamically through custom.pll. I know that we can dynamically change the Record group query.
    Please help me its a bit urgent.
    Thanks inadvance,
    Amarnadh Js

    you can control your record group runtime without create any recordgroup at design time..
    1.static group
    declare
       rg_name         VARCHAR2 (40)  := 'Global_Rgp_Menu';     --global record group name for menu use
       rg_id           recordgroup;                                            --global record group id
       gc_id           groupcolumn;                                     --global record group coulmn id
       errcode         NUMBER;                                                             --error code
       grp_row         PLS_INTEGER    := 0;                             --global record group row count
    begin
      rg_id := FIND_GROUP (rg_name);
       IF NOT ID_NULL (rg_id)
       THEN
          DELETE_GROUP_ROW (rg_id, all_rows);
       ELSE
          rg_id := CREATE_GROUP (rg_name, global_scope);
          gc_id := ADD_GROUP_COLUMN (rg_id, 'menu_item', char_column, 100);
          gc_id := ADD_GROUP_COLUMN (rg_id, 'p_type', char_column, 100);
          gc_id := ADD_GROUP_COLUMN (rg_id, 'p_no', char_column, 100);    
       END IF;
      grp_row := 0;
      for 1 in 1..10 loop
           grp_row := grp_row + 1;
          ADD_GROUP_ROW (rg_id, grp_row);
          SET_GROUP_CHAR_CELL (rg_name || '.menu_item', grp_row, 'menu' || to_char(i) );
          /*type*/
          SET_GROUP_CHAR_CELL (rg_name || '.p_type', grp_row,  'type' || to_char(i) );
          /*program_no */
          SET_GROUP_CHAR_CELL (rg_name || '.p_no', grp_row,  'programno' || to_char(i) ); 
      end loop;
    end;
    2. query group
    declare
       FACT_SQL VARCHAR2(500) :=NULL;
       rg_name1       VARCHAR2(40) := 'Global_Rgp_fact';
       rg_id1   RecordGroup;
       Error_Flag number:=0;
       group_error exception;
    begin
       rg_id1 := Find_Group( rg_name1 ); IF NOT Id_Null(rg_id1) THEN Delete_Group( rg_id1 ); END IF;     
       FACT_SQL := ' SELECT *   FROM MYFACTORY  ' ;      
       rg_id1 := Create_Group_From_Query( rg_name1,FACT_SQL ,global_scope);
        Error_Flag := POPULATE_GROUP(rg_id1);
        IF Error_Flag <>0 THEN     
               error_msg:='Error while populating factory group';   
               raise group_error;
        END IF; 
    exception
      when group_error then
         message(error_msg);
        raise;
    end;Edited by: nolemlin on 2010/3/23 上午 7:50

  • Creating Record Group dynamically.

    Hi,
    I have multi line block. My req is i have create record group dynamically based on some fields in line level. This my code in To Location - Key next item,
    DECLARE
    group_id          RecordGroup;
    v_lms_lov lov;
    BEGIN
    group_id := Create_Group_From_Query ('RG_LMSID',
    'SELECT lms_id
    FROM sify_lms_header
    WHERE from_location = :lines.from_location
    AND to_location = :lines.to_location;'
    v_lms_lov := find_lov('LOV_LMSID');
    set_lov_property(v_lms_lov,group_name,'RG_LMSID');
    Set_Item_Property('LINES.LMS_ID',LOV_NAME,'LOV_LMSID');
    END;
    It says, no records in lov. Anything i missed.
    Or any other way to achieve this.
    Pl help.
    Thanks
    Kavitha

    Kavitha,
    Why you need Dynamic record group for this?, you can give the control names in the record group query. Then the record group's query will be
    SELECT LMS_ID FROM SIFY_LMS_HEADER WHERE FROM_LOCATION = :LINES.FROM_LOCATION AND TO_LOCATION = :LINES.TO_LOCATIONAnd if you still want to use the dynamic record group creation, then try
    DECLARE
         RG_Group_ID RECORDGROUP;
    BEGIN
         RG_Group_ID := FIND_GROUP('RG_LMSID');
      IF NOT Id_Null(RG_Group_ID) THEN
              DELETE_GROUP(RG_Group_ID);
      END IF;
         RG_Group_ID := CREATE_GROUP_FROM_QUERY('RG_LMSID', 'SELECT LMS_ID FROM SIFY_LMS_HEADER WHERE FROM_LOCATION = ''' || :LINES.FROM_LOCATION || ''' AND TO_LOCATION = ''' || :LINES.TO_LOCATION || '''');
         SET_LOV_PROPERTY('LOV_LMSID',     GROUP_NAME, 'RG_LMSID');
         SET_ITEM_PROPERTY('LINES.LMS_ID', LOV_NAME,   'LOV_LMSID');
    END;Regards,
    Manu.
    If my response or the response of another was helpful, please mark it accordingly

  • Strange Problem in dynamically list population with record group

    Hello Room,
    I am dynamically populating a single list with 2 record groups. I am having a strange problem. All the code are written in 2 seperate buttons. The code of every button is given below.
    Button 1 code:-
    DECLARE
    rg_reports RECORDGROUP;
    rg_name VARCHAR2(40) := 'REPORTS';
    vTemp NUMBER;
    BEGIN
    -- Pls make sure Group doesn't already exist
    rg_reports := FIND_GROUP(rg_name);
    -- If it doesn't exist then create it and add ur query to it
    IF Id_Null (rg_reports) THEN
    rg_reports:=CREATE_GROUP_FROM_QUERY(rg_name , 'SELECT companyname,to_char(co) from companymaster order by companyname');
    end if;
    --Populate the Record Group
    vTemp:=POPULATE_GROUP(rg_reports);
    POPULATE_LIST('REPORTS.EXAMPLELIST', rg_name);
    Delete_Group( rg_reports );
    END;
    Button 2 Code:-
    DECLARE
    rg_reports RECORDGROUP;
    rg_name VARCHAR2(40) := 'REPORTS';
    vTemp NUMBER;
    BEGIN
    -- Pls make sure Group doesn't already exist
    rg_reports := FIND_GROUP(rg_name);
    -- If it doesn't exist then create it and add ur query to it
    IF Id_Null (rg_reports) THEN
    rg_reports:=CREATE_GROUP_FROM_QUERY(rg_name , 'SELECT accountname,to_char(co) from accountmaster order by accountname');
    end if;
    --Populate the Record Group
    vTemp:=POPULATE_GROUP(rg_reports);
    POPULATE_LIST('REPORTS.EXAMPLELIST', rg_name);
    Delete_Group( rg_reports );
    END;
    The code is same here only the sql is different in these 2 buttons. Now the problem point.
    when i press button 1, I get the list populated ok. when i try to click on the list item and keep the button pressed the list gets scrolled properly.
    when i press button 2 after that i get account names well populated in the same list item as well, but this time, when i keep the button pressed the list does not scroll below as in button 1. It does not even allow to select different item from the list of button 2 code.
    I tried to clear cache, cookies, exit browser everything and try to run the button 2 first, but still the problem in button 2 code.
    Following are my system details.
    windows 7 professional edition.
    Oracle database 11g on windows 7
    Oracle forms 10g patchset 10.1.2.0.2 on windows 7
    Browser Netscape Navigator with oracle jinitiator 1.3.1.22
    But this form is run by a client side html file where oracle forms 10g is not installed on windows xp. html file is just referring server url to run the module. The file is run on Netscape navigator browser with oracle jinitiator 1.3.1.22
    My question is that is this a bug ? if button 1 gets the list item scrolled, why is the problem with button 2 even though i press it first. Here I am deleting the record group also. after the code is over. Initially I thought this may be the character length problem so I took the maximum character length for that list item as given by the 2 columns in database.
    Why is the list scrolling not happening in button 2 but in button 1 with same codes on both ?
    Anybody please help me.

    The problem is the second query. I would guess that the TO_CHAR(co) is not unique for each account, but is the same for the accounts. And as the second item in the select-list is the listitems values, all your listitem-entries have the same value. therefore, of you select any entry, the list will always go the the first entry again.
    Adjust your query.

  • Dynamic record group not working when apostrophes are used

    Hi Everyone,
    I have developed a Form for the most part everything is working as expected. However, there is a search functionality that is giving me problems. The issue is that when the user enters search criteria for last_name that has an apostrophe (O'brian) the search lov doesn't get populated because the dynamic record group is not getting created when the string has an apostrophe (ie O'brian). I have a dynamic record group that takes the user's search criteria and populates an LOV on the screen with the records that matched their criteria.
    Here is the code that is behind my search button where the dynamic RG gets created. It works fine for all searches that don't contain an apostrophe. Btw, the Oracle Forms version is 10g.
    DECLARE
    p_where_debtor varchar2(2000);
    p_where_liab varchar2(2000);
    rg_id RecordGroup;
    v_query varchar2(2000) := null;
    rg_name varchar2(2000):= 'RG_LIAB_LST';
    errcode NUMBER;
    BEGIN
    IF :SEARCH.cd_nb is null and
    :SEARCH.cd_seq is null and
    :SEARCH.f_name is null and
    :SEARCH.l_name is null and
    :SEARCH.mi_name is null
    then
    display_message ('Search criteria must be entered');
    raise form_trigger_failure;
    END IF;
    v_query := 'SELECT last_name, first_name, middle_name, c_no, c_seq
    FROM TABLE_VW2 WHERE 1=1';
    /*Search criteria entered by user*/
    IF :SEARCH.l_name_srch IS NOT NULL THEN
    v_query := v_query||' AND UPPER(last_name) LIKE '''||UPPER(:SEARCH.l_name)||'%''';
    END IF;
    IF :SEARCH.f_name_srch IS NOT NULL THEN
    v_query := v_query||' AND UPPER(first_name) LIKE '''||UPPER(:SEARCH.f_name)||'%''';
    END IF;
    IF :SEARCH.mi_srch IS NOT NULL THEN
    v_query := v_query||' AND UPPER(middle_name) LIKE '''||UPPER(:SEARCH.mi_name)||'%''';
    END IF;
    IF :SEARCH.cdcs_nbr_srch IS NOT NULL THEN
    v_query := v_query||' AND UPPER(c_no) LIKE '''||UPPER(:SEARCH.cd_nb)||'%''';
    END IF;
    IF :SEARCH.cdcs_seq_srch IS NOT NULL THEN
    v_query := v_query||' AND UPPER(c_seq) LIKE '''||UPPER(:SEARCH.cd_seq)||'%''';
    END IF;
    /*Make sure record group doesn't exisit*/
    rg_id := Find_Group(rg_name);
    /*If it doesn't exist then create record group*/
    IF id_null(rg_id) THEN
    rg_id:= create_group_from_query(rg_name,v_query);
    END IF;
    IF NOT id_null (rg_id) THEN
    delete_group (rg_id);
    rg_id:= create_group_from_query(rg_name, v_query);
    END IF;
    errcode := Populate_Group(rg_id);
    Any help would be greatly appreciated.
    Thanks,
    Adrian

    For every item where an apostroph can occur, do a
    REPLACE(:BLOCK.ITEM, '''', '''''');

  • (urgent) Dynamic record groups and LOV

    I have to create a record group and then add 2 rows to it manually.Following is the code.There are no values displayed in the lov.Please help.
    PROCEDURE create_record_group IS
    BEGIN
    DECLARE
    rg varchar2(40) := 'test_fips';
    rg_id RECORDGROUP;
    lov_id Lov;
    err NUMBER;
    gc_id1 GROUPCOLUMN;
    gc_id2 GROUPCOLUMN;
    counter number;
    BEGIN
    rg_id := FIND_GROUP(rg);
    lov_id := FIND_LOV('LOV_FIPS');
    IF NOT ID_NULL(rg_id) THEN
    DELETE_GROUP(rg_id);
    END IF;
    IF ID_NULL(rg_id) THEN
    rg_id := CREATE_GROUP(rg);
    gc_id1 := add_group_column (rg_id,'col1',number_column);
    gc_id2 := add_group_column(rg_id,'col2',char_column,40);
    END IF;
    /* adding static content to LOV */
    ADD_GROUP_ROW( rg_id,1);
    SET_GROUP_NUMBER_CELL(gc_id1,1,997);
    SET_GROUP_CHAR_CELL(gc_id2,1,'MLAB');
    counter := get_group_row_count(rg_id);
    /* adding dynamic content */
    FOR rec in (SELECT FIPS_CD COL1, LOCNAME COL2 FROM FIPS) LOOP
    counter := counter +1 ;
    ADD_GROUP_ROW( rg_id, counter);
    SET_GROUP_NUMBER_CELL(gc_id1,counter,rec.col1);
    SET_GROUP_CHAR_CELL(gc_id2,counter,rec.col2);
    END LOOP;
    SET_LOV_PROPERTY('LOV_FIPS',GROUP_NAME, rg);
    END;
    END;

    I tried creating the group the way you suggested but it does not seem to work because of 'UNION' in the query.It says unable to create rcord group.Did you anytime use the 'UNION' option while creating record group.
    While creating record group at design time also you cannot use UNION with dual.
    This how I modified :
    PROCEDURE create_record_group IS
    BEGIN
    DECLARE
    V_RG_ID RECORDGROUP;
    RG_NAME VARCHAR2(20) := 'TEST_FIPS';
    V_ERRCODE NUMBER;
    BEGIN
    V_RG_ID := FIND_GROUP('TEST_FIPS');
    IF ID_NULL(V_RG_ID) THEN
    V_RG_ID := CREATE_GROUP_FROM_QUERY('TEST_FIPS', 'SELECT FIPS_CD, LOCNAME FROM FIPS
    UNION SELECT 997,'MLAB' FROM DUAL');
    END IF;
    V_ERRCODE := POPULATE_GROUP(V_RG_ID);
    MESSAGE('CREATED '|| V_ERRCODE);
    SET_LOV_PROPERTY('LOV_FIPS',GROUP_NAME, RG_NAME);
    END;
    END;
    Notice here 'MLAB' is char and I get compilation error if I use these quotes with MLAB.But is I remove the quotes the it compiles.
    Thanks

  • Error during Creation of Product Group

    Hi experts
    I am getting below error during creation of Product Group MC84,
    how to solve this
    The field  is defined as a required field; it does not contain an entry
    Message no. MG144
    Procedure
    Transfer a suitable value.
    If the field is the material group or unit of weight, and the field is not ready for input, check whether the material is locked. If it is locked, you cannot extend the Purchasing view or the Sales view. If either of these views needs to be extended, the material must first be unlocked. This can be done only by a user with special authorization. Contact your system administrator.
    Note
    For information on locking and unlocking material master records, see the SAP library documentation Material Master (LO-MD-MM) ->Locking Material Master Records.

    Hi,
    Please refer the below thread,
    PRODUCT GROUP
    Regards,
    Senthilkumar

  • How to create Static Record group in Oracle Forms??

    Dear All,
    I have the following values V1,V2 to be placed in my list item field during DML operations.
    I have an example to create the record group based on the table; whereas i have never tried for static value creation.
    Could you please guide me how can i acheive this.?
    Thanks ....
    Regards,
    Sunil.G

    Thanks dhivya for your reply.
    Actually what happens is; when i use the same methodology as you mentioned, it is asking me to set the Initial value.
    Whereas in my applications; user has to manually select any of the values i.e eithe V1 or V2 for the first time.
    Moreover i have found the query:-
    I have created a static record group RG_VERSIONS i.e creating a new record group with the static values mentioning the "Column names " as "Version_label" which i have given the column values as "V1" and "V2" and then another column name as "Version_value" with the column values as "V1" and "V2".
    Then i used the below query in the WHEN-NEW-FORM-INSTANCE trigger:-
    PROCEDURE p_when_new_form_instance
    IS
    l_rg_id recordgroup;
    l_item_id item;
    BEGIN
    --Populating value for  Version Type based on static record group
    l_rg_id := FIND_GROUP ('RG_VERSION');
    IF NOT ID_NULL (l_rg_id)
    THEN
    l_item_id := FIND_ITEM ('BLOCKNAME.COLUMN_NAME');
    POPULATE_LIST (l_item_id, l_rg_id);
    END IF;
    END p_when_new_form_instance;
    Then it was working fine.
    Thanks for your time.
    Regards,
    Sunil.G
    Edited by: Sunil G on Jun 27, 2010 6:00 AM

  • Can I know the name, type, total number of column in Record Group?

    I created a record group with query dynamically.
    And then populated it.
    I don't know the column' count, type, name befause I get the query from user at runtime.
    Can I know the name, type, total number of column in Record Group?

    Unfortunately, there is no way to query the record group (RG) to get the metadata you are looking for. RGs are best used as data sources to an LOV or List Item rather than as an Array to hold the resultset of a dynamic query. For this, I would recommend you use a Collection type of construct (PL/SQL Table of Records, VArray, etc).
    Craig...

  • Using 'like' in record group query

    Hi ,
    (Forms 6i)
    I'm creating a record group dynamically.
    So in when new item trigger for a list item,
    i want to list all names from a table like 'a%';
    query : select name, to_char(id) id from test_name where name like 'a%';
    but i'm not able give single quote(') in the query.
    Is there a way to do that?
    Edited by: Tuts009 on May 9, 2010 1:38 AM

    Hi Arif,
    i'm not giving a% directly in the query, this i'm getiing from what we type in the list , so :list4
    i'm storing it in another string say str and then the query will be
    str := :list4||'%';
    rg_id := Create_Group_From_Query( rg_name,
                               'SELECT name,to_char(id) id from test_name where name like '||str); Now any help?

  • URGENT : Record Group Problem

    hello all
    i have a problem regarding record group.
    i want to populate my record group with a dynamic clause which is
    "and main_code not in ('02725','02868')"
    and my record group query is
    "select mt.main_number from main_table mt,main_parent mp
    where mt.main_code = mp.main_code
    and mt.main_code not in (:parameter.param_main_code)"
    now i am adopting the following method for populating the
    LOV(list of values) which is attached to a text item:
    assigning values i.e. '02725','02868' to my parameter object i.e. :parameter.param_main_code but the record group is not giving changd results according to my criteria i.e.'02725','02868'...
    does any body knows the solution for this problem..kindly help him with it..logically the record group query should work and return a changed results for the LOV..
    please help me with this.....
    thank you.

    I thing you can't able to do what you are trying to do, but you can achive this by using dynamic record group.
    Create the dynamic record as same struncture of design time then populate it by the coding.
    Sample Code is
    declare
         l_rec_name RecordGroup;
         l_rec_col GroupColumn;
         l_rec_col1 GroupColumn;     
         cursor l_ename is select ename from emp;
         l_row number(12):= 1;
    begin
         l_rec_name := create_group('rg_dynamic',Form_scope, 100);
         l_rec_col := add_group_column(l_rec_name,'ENAME',char_column,30);
         l_rec_col1 := add_group_column(l_rec_name,'EMPNO',number_column,6);     
         for i in l_ename
         loop
              add_group_row(l_rec_name, end_of_group);
    set_group_char_cell(l_rec_col,l_row, i.ename);
    set_group_number_cell(l_rec_col1,l_row, l_row);
    l_row := l_row+1;
         end loop;
         :parameter.num_rows := l_row -1;
         set_lov_property('LOV5',group_name,'RG_DYNAMIC');
    end;
    I hope this will help you to solve this problem.
    [email protected]

Maybe you are looking for