One LOV multiple Record Groups

Hi all
I have 2 text items text A and Text B
on text A i have a list with two items Say 'cricket' and 'football'
I have two record groups 'Cricket' and 'football'
If i select 'cricket' from text A then the LOV for text B should have the 'Cricket' record group attached
and if i select 'football' from text A then the LOV for text B should have the football record Group attached
Please tell me how to do it
Thanks in advance

Hi,
why don't you just create two LOV's and exchange them on the fly?
WHEN-VALIDATE-ITEM Trigger on "A" :
IF( :A = 'cricket' )
THEN
set_item_property( 'B', LOV_NAME, 'Cricket' );
ELSIF( :A = 'football' )
THEN
set_item_property( 'B', LOV_NAME, 'Football' );
ELSE
set_item_property( 'B', LOV_NAME, NULL );
END IF;
Another possibility would be to create a KEY-LISTVAL Trigger on "B" use "show_lov" to switch between both LOV's.
Regards
Markus

Similar Messages

  • Select one among multiple record

    Dear all,
    how can i create a select statement which returns only one record if there are the same values in tkn and numero column?
    Table ROSE
    TKN NUMERO
    75684523 4523
    75684523 4523
    75684523 4523
    Thank you,

    You can just use DISTINCT keyword if you have just two columns in your table
    with t as
        select 75684523 tkn, 4523 numero from dual union all
      select 75684523, 4523 from dual union all
      select 75684523, 4523 from dual union all
      select 99984523, 3333 from dual union all
      select 99984523, 3333 from dual
    select distinct tkn,numero from t;
    TKN                    NUMERO                
    99984523               3333                  
    75684523               4523       Or if you have more number of columns in the table but still you want to get only one row then you can use either of the above mentioned methods by gurus.
    with t as
        select 75684523 tkn, 4523 numero, 12 eid from dual union all
      select 75684523, 4523, 12 from dual union all
      select 75684523, 4523, 13 from dual union all
      select 99984523, 3333, 14 from dual union all
      select 99984523, 3333, 15 from dual
    select l.tkn, l.numero, eid
      from
           select t.tkn, t.numero,eid, row_number() over (partition by t.tkn, t.numero order by 1) rn
           from t
         ) l
    where rn = 1
    /

  • 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

  • Dropdown from record group?

    I am new to oracle, i need to have dropdown value list from a database, i know LOV, but it does not support dropdown so i need some way from LOV or from Record group.
    Please if anybody guide me that how can i make a dropdown linst using LOV or Record Group.
    I am using 10g forms.
    Kind Regards
    Naveed

    You can populate list item (if you mean list item) using record group.
    Example: you can use create_group_from_query and populate_group built-ins to get the values from database into record group.
    Then you can use populate_list to populate list item.
    Also, have a look at Oracle Forms help for more information and examples on built-ins.
    regards
    Srinidhi Rao

  • Merging multiple records onto one page

    I have two questions for successfully setting up a mail merge:
    1.  I have a .csv file that contains multiple records.  All but one column contains one line of text.  I have one column in the record that contains several paragraphs of text.
    Problem:  The merge sees the paragraph returns (or line breaks) as an indicator to go to the next record.  What's the work-around for this?
    2.  I need the records to flow one after another.
    Problem:  It's merging one record per page.
    Background that may help (maybe merge is not the feature I should be using):
    I'm designing a newspaper that contains about 150 book reviews.  The reviews stem from a database that I'm exporting as a csv.  Rather than converting/formatting the reviews from the database by hand (like I have been doing), I thought InDesign must have some automated way of handling this.
    This is an example of what one record looks like:
    Italian For Beginners
    By Kristen Hammel
    Random House, $12.95, 53 pages
    Don’t be fooled by the //Italian for Beginners// cover photo of an Audrey Hepburn look-alike on the back on an Italian motorcycle with her arms around a handsome man. This novel is stronger and meatier than another  “American falls in love in Italy” love story.  Yes, the protagonist Cat Connelly escapes to Italy to find herself after tiring of being the center of everyone’s dismay as an unmarried 34-year-old overly-responsible sister, daughter, and granddaughter.
    And yes, there is romance, but it comes with a twist.  The best part of the novel is watching Cat shed her carefully constructed identity and past.  Harmel’s character discovers an authentic Rome from a family, insider’s perspective. The Italizan zest for life and her own connection to Italy allows her to throw off her accountant-style persona and take risks.  As Cat examines her deep-seated fears and biases,  she also discovers those things that give her true peace, joy and satisfaction.
    Will Cat fall in love with a handsome Italian? Or will she fall in love with her own long-suppressed Italian heritage and natural gifts? Read the novel to find out, and you’ll also find a bonus at the end of the novel: five authentic  recipes inspired by Italian for Beginners.  Mangi, mangi, buon appetito!
    Reviewed by John Smith
    Can anyone help?

    First the easy part. To get multiple records per page, create only one placeholder in the upper left position. ID duplicates EVERYTHING on the page as many times as it can using your spacing selections. If you have one element at the top of the page and another at the bottom, for example, ID will not be able to put additional records on that page because there is no space.
    Text frames should be no larger than necessary to hold the data. They won't grow or shrink to fit during the merge, so you'll have gaps if the length of the text varies from record to record.
    Now, for how to fix the line-break problem. In the data file substitute a character, or group of characters you won't be using anywhre else for each return. After the merge use Find/Change to replace the substituted cahracters with real breaks.
    Peter

  • Add Multiple records to G/L account group.

    Dear ABAP Experts,
    i have requirement that is using  BDC recording file  the Functional People wants to add records to the G/L Account group. The FI consultant gave the recording file, based on the recording file i developed a BDC program. This BDC program will work for single record. After creating single record system will ask for transport request .
    REPORT  ZDP_ACC_GRP.
    TYPES: BEGIN OF TY_TAB,
            KTOPL TYPE KTOPL,
            KTOKS TYPE KTOKS,
            TXT30 TYPE TXT30,
            VONNR TYPE VONNR,
            BISNR TYPE BISNR,
           TRKORR TYPE TRKORR,
       END OF TY_TAB.
    data: lt_tab type table of ty_tab,
           wa_tab type ty_tab.
    data: begin of record,
    * data element: KTOPL
             KTOPL_01_001(004),
    * data element: KTOKS
             KTOKS_01_002(004),
    * data element: TXT30_077T
             TXT30_01_003(030),
    * data element: VONNR_077S
             VONNR_01_004(010),
    * data element: BISNR_077S
             BISNR_01_005(010),
    * data element: TRKORR
             TRKORR_006(020),
           end of record.
    *       Batchinputdata of single transaction
    DATA:   BDCDATA type table of BDCDATA  WITH HEADER LINE.
    *       messages of call transaction
    DATA:   MESSTAB type table of BDCMSGCOLL  WITH HEADER LINE.
    *       error session opened (' ' or 'X')
    DATA:   E_GROUP_OPENED.
    *       message texts
    TABLES: T100.
    data:lv_file type string.
    parameters: p_fname type IBIPPARMS-PATH.
    at selection-screen on value-request for p_fname.
    CALL FUNCTION 'F4_FILENAME'
      EXPORTING
        PROGRAM_NAME        = SYST-CPROG
        DYNPRO_NUMBER       = SYST-DYNNR
        FIELD_NAME          = 'P_FNAME'
      IMPORTING
        FILE_NAME           = p_fname .
    start-of-selection.
    lv_file = p_fname.
    CALL FUNCTION 'GUI_UPLOAD'
       EXPORTING
         FILENAME                      = LV_FILE
    *   FILETYPE                      = 'ASC'
        HAS_FIELD_SEPARATOR           = 'X'
       TABLES
         DATA_TAB                      = LT_TAB
      EXCEPTIONS
        FILE_OPEN_ERROR               = 1
        FILE_READ_ERROR               = 2
        NO_BATCH                      = 3
        GUI_REFUSE_FILETRANSFER       = 4
        INVALID_TYPE                  = 5
        NO_AUTHORITY                  = 6
        UNKNOWN_ERROR                 = 7
        BAD_DATA_FORMAT               = 8
        HEADER_NOT_ALLOWED            = 9
        SEPARATOR_NOT_ALLOWED         = 10
        HEADER_TOO_LONG               = 11
        UNKNOWN_DP_ERROR              = 12
        ACCESS_DENIED                 = 13
        DP_OUT_OF_MEMORY              = 14
        DISK_FULL                     = 15
        DP_TIMEOUT                    = 16
        OTHERS                        = 17  .
    LOop at  lt_tab into wa_tab.
    perform bdc_dynpro      using 'SAPL0F09' '0020'.
    perform bdc_field       using 'BDC_CURSOR'
                                   'V_T077S-TXT30(01)'.
    perform bdc_field       using 'BDC_OKCODE'
                                   '=NEWL'.
    perform bdc_dynpro      using 'SAPL0F09' '0020'.
    perform bdc_field       using 'BDC_CURSOR'
                                   'V_T077S-BISNR(01)'.
    perform bdc_field       using 'BDC_OKCODE'
                                   '=SAVE'.
    perform bdc_field       using 'V_T077S-KTOPL(01)'
                                   WA_TAB-KTOPL."record-KTOPL_01_001.
    perform bdc_field       using 'V_T077S-KTOKS(01)'
                                   WA_TAB-KTOKS."record-KTOKS_01_002.
    perform bdc_field       using 'V_T077S-TXT30(01)'
                                   WA_TAB-TXT30."record-TXT30_01_003.
    perform bdc_field       using 'V_T077S-VONNR(01)'
                                   WA_TAB-VONNR."record-VONNR_01_004.
    perform bdc_field       using 'V_T077S-BISNR(01)'
                                   WA_TAB-BISNR."record-BISNR_01_005.
    perform bdc_dynpro      using 'SAPLSTRD' '0300'.
    perform bdc_field       using 'BDC_CURSOR'
                                   'KO008-TRKORR'.
    perform bdc_field       using 'BDC_OKCODE'
                                   '=LOCK'.
    perform bdc_field       using 'KO008-TRKORR'
                                   WA_TAB-TRKORR."record-TRKORR_006.
    perform bdc_dynpro      using 'SAPL0F09' '0020'.
    perform bdc_field       using 'BDC_CURSOR'
                                   'V_T077S-KTOPL(02)'.
    perform bdc_field       using 'BDC_OKCODE'
                                   '=BACK'.
    perform bdc_dynpro      using 'SAPL0F09' '0020'.
    perform bdc_field       using 'BDC_CURSOR'
                                   'V_T077S-KTOPL(02)'.
    perform bdc_field       using 'BDC_OKCODE'
                                   '=BACK'.
    perform bdc_transaction using 'OBD4'.
    ENDLOOP.
    FORM BDC_TRANSACTION USING TCODE.
       DATA: L_MSTRING(480).
       DATA: L_SUBRC LIKE SY-SUBRC.
    * batch input session
    * call transaction using
         REFRESH MESSTAB.
         CALL TRANSACTION 'OBD4' USING BDCDATA
                          MODE  'A'" CTUMODE
                          UPDATE 'S'"CUPDATE
                          MESSAGES INTO MESSTAB.
         L_SUBRC = SY-SUBRC.
           LOOP AT MESSTAB.
             SELECT SINGLE * FROM T100 WHERE SPRSL = MESSTAB-MSGSPRA
                                       AND   ARBGB = MESSTAB-MSGID
                                       AND   MSGNR = MESSTAB-MSGNR.
             IF SY-SUBRC = 0.
               L_MSTRING = T100-TEXT.
               IF L_MSTRING CS '&1'.
                 REPLACE '&1' WITH MESSTAB-MSGV1 INTO L_MSTRING.
                 REPLACE '&2' WITH MESSTAB-MSGV2 INTO L_MSTRING.
                 REPLACE '&3' WITH MESSTAB-MSGV3 INTO L_MSTRING.
                 REPLACE '&4' WITH MESSTAB-MSGV4 INTO L_MSTRING.
               ELSE.
                 REPLACE '&' WITH MESSTAB-MSGV1 INTO L_MSTRING.
                 REPLACE '&' WITH MESSTAB-MSGV2 INTO L_MSTRING.
                 REPLACE '&' WITH MESSTAB-MSGV3 INTO L_MSTRING.
                 REPLACE '&' WITH MESSTAB-MSGV4 INTO L_MSTRING.
               ENDIF.
               CONDENSE L_MSTRING.
               WRITE: / MESSTAB-MSGTYP, L_MSTRING(250).
             ELSE.
               WRITE: / MESSTAB.
             ENDIF.
           ENDLOOP.
       REFRESH BDCDATA.
    ENDFORM.
    FORM BDC_DYNPRO USING PROGRAM DYNPRO.
       CLEAR BDCDATA.
       BDCDATA-PROGRAM  = PROGRAM.
       BDCDATA-DYNPRO   = DYNPRO.
       BDCDATA-DYNBEGIN = 'X'.
       APPEND BDCDATA.
    ENDFORM.
    FORM BDC_FIELD USING FNAM FVAL.
         CLEAR BDCDATA.
         BDCDATA-FNAM = FNAM.
         BDCDATA-FVAL = FVAL.
         APPEND BDCDATA.
    ENDFORM.
    But the FI consultant wants to add multiple records to 'G/L account group'.After adding records before saving the system need to ask transport request at the last.
    How can I write code ...??
    Please help me.

    Hi Srikanth,
    Thanks for reply,
    You  are right we need to load hierarchy for G/L then we can see all the G/L's for all G/L groups.
    I have one more question when I check in RSA3 for the G/L account numbers, I could not find them.
    I am using the datasource fi_gl_4 and in rsa3 I can see 1000 records data and when I put filter on G/L account and search for the G/L number I needed I cant see it, but it is there in the functional transaction(f.01)?
    How to check for the required G/L's in rsa3 ?
    Thx

  • One to Many table join -- concat field per record grouped by id

    Post Author: wm5
    CA Forum: Formula
    Hello,
    I am using Crystal Reports XI and have two tables that have a one to many relationship and are joined by an JobID (number).
    Below is a sample with relative fields for each table.
    job_table: JobID (number), Manager (text), Status (text)
    jobaudit_table : JobAuditID (number), JobID (Number), FormID (Number)
    There is a one to many relationship with jobaudit_table having multiple records for each JobID in job_table.
    I have created a Group Header using the job_table.JobID and suppressed the detail section.
    In the group header for each JobID I display the JobID, Manager, Status. I also use the below formula to determine if any records in the jobaudit_table has a record where FormID = 90. If so, I display "Yes". If not, "No".
    So my report currently looks like.
    JobID     Manager     Status     Audit Performed
    1           Manager 1  Closed           N
    2          Manager 2   Closed           Y
    Here are the formula's I use to determine if any records in jobaudit_table contains a record where FormID = 90.
    @ja90exists
    if {jobaudit_table.FormID} = 90 then    1else    0;
    if sum({@ja90exists},{job_table.JobID}) = 0 then    "No"else    "Yes";
    Everything so far works fine. What I would like to do now is add a hyperlink to a script to view the job audit when in the above report the "Audit Performed" column is "Yes"
    So Report is now:
    JobID     Manager     Status     Audit Performed
    1           Manager 1  Closed           N
    2          Manager 2   Closed           Y (hyperlink to view audit)
    I cannot figure out how to gather the valid JobAuditIDs where FormID = 90 grouped by JobID to be used in the Group Heading section of the report.
    Also, it is unlikely, but possible that more than one job_audit record exists with FormID = 90 per JobID. So, my hyperlink could look like http://mysite.com/viewjobaudit.aspx?jobid=[jobaudit_table.JobAuditID],[jobaudit_table.JobAuditID] .
    Thanks for any help. And if this post is not clear let me know and I will clarify.
    wm5

    Post Author: bettername
    CA Forum: Formula
    Although I can't think of a way to get multiple hyperlinks, this should be a start.  It (should) hyperlink to the last job/audit in the group that formID of 90.  Oh, I assumed that the hyperlink should have been  xxxx...jobID,jobAuditID! 
    I think there may be a way of getting hyperlinks to every "90" record, but that will involve a subreport, so lets try this first...
    1 - everything from your group header to the group footer...
    2 -  add a formula into the group header that says:
    whileprintingrecords;
    stringvar jobauditID="";
    stringvar jobID:=";
    3 - Then add a formula to the details section:
    whileprintingrecords;
    stringvar jobauditID;
    stringvar jobID;
    if {jobaudit_table.FormID} = 90
    then (jobID:=totext({job_table.job_id},0,""); jobauditID:=totext({jobaudit_table.jobaudit_id},0,"")
    4 - Finally, on your "Audit Performed" formula, have a conditional hyperlink that says:
    whileprintingrecords;
    stringvar jobauditID;
    stringvar jobID;
    if {@audit performed} = "Y" then http://mysite.com/viewjobaudit.aspx?jobid=jobID","+jobauditID

  • 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.

  • LOV with 3 record groups

    I have two LOV s one in the mainform and one in the subform. If I select one category from the list in the mainform LOV. In the subform LOV has to change it's record group (3 record groups) depending on the category selected in the mainform LOV. Please help. I am pasting the code I wrote. I tried it in the NEW ITEM INSTANCE TRIGGER, NEW BLOCK INSTANCE TRIGGER (datablock for the 2nd LOV with 3 record groups) and in the NEW FORM INSTANCE TRIGGER. Please help. Thank you.
    DECLARE
    lov_id1 LOV;
         --val          boolean;
              rg_id1 RECORDGROUP;
         rg_id2 RECORDGROUP;
              rg_id3 RECORDGROUP;
    BEGIN
    lov_id1 := FIND_LOV ('ACTIVITYTYPE_LOV');
         rg_id1 := FIND_GROUP('ACTIVITYTYPE_RG1');
         rg_id2 := FIND_GROUP('ACTIVITYTYPE_RG2');
         rg_id3 := FIND_GROUP('ACTIVITYTYPE_RG3');
    --     val := SHOW_LOV(lov_id1, 32, 48);
    IF
         GET_LOV_PROPERTY(lov_id1,GROUP_NAME ) = 'rg_id1' AND :YOUTH_GOALS.GOAL_TYPE = 'EXIT COUNSELING'
         THEN SET_LOV_PROPERTY(lov_id1,GROUP_NAME,'rg_id1');
         ELSIF
         GET_LOV_PROPERTY(lov_id1,GROUP_NAME ) = 'rg_id1' AND :YOUTH_GOALS.GOAL_TYPE = 'COMPLETE TRAINING'
         THEN SET_LOV_PROPERTY(lov_id1,GROUP_NAME,'rg_id1');
              ELSIF
         GET_LOV_PROPERTY(lov_id1,GROUP_NAME ) = 'rg_id1' AND :YOUTH_GOALS.GOAL_TYPE = 'VOCATIONAL TRAINING'
         THEN SET_LOV_PROPERTY(lov_id1,GROUP_NAME,'rg_id2');
              ELSIF
         :YOUTH_GOALS.GOAL_TYPE = 'GRADUATE FROM HIGH SCHOOL'AND GET_LOV_PROPERTY(lov_id1,GROUP_NAME ) = 'rg_id1'
         THEN SET_LOV_PROPERTY(lov_id1,GROUP_NAME,'rg_id2');
              ELSIF
         :YOUTH_GOALS.GOAL_TYPE = 'IMPROVE ACADEMIC PERFORMANCE'AND GET_LOV_PROPERTY(lov_id1,GROUP_NAME ) = 'rg_id1'
         THEN SET_LOV_PROPERTY(lov_id1,GROUP_NAME,'rg_id2');
              ELSIF
         :YOUTH_GOALS.GOAL_TYPE = 'OBTAIN GED'AND GET_LOV_PROPERTY(lov_id1,GROUP_NAME ) = 'rg_id1'
         THEN SET_LOV_PROPERTY(lov_id1,GROUP_NAME,'rg_id2');
              ELSIF
         :YOUTH_GOALS.GOAL_TYPE = 'NON-ACADEMIC'AND GET_LOV_PROPERTY(lov_id1,GROUP_NAME ) = 'rg_id1'
         THEN SET_LOV_PROPERTY(lov_id1,GROUP_NAME,'rg_id3');
         END IF;
    end;

    try on when-validate-item or on POST-CHANGE
    Regards,
    Danish Hayder

  • Record groups and LOV

    HI
    I have a question regarding LOV's.
    I have 2 fields dept_code which is a checkbox and field2 which is an LOV displaying the employee names based on the dept_code selected.
    My record group has a query like this -
    SELECT empname FROM emp WHERE dept_code IN(:parameter.P_dept_code). p_dept_code is char.
    If the user enters multiple department codes then my p_dept_code should contain commas and single quotes for each department like this ('m10','m20')
    In which trigger do I do this coding and how do I do it?
    Thanks.

    Hi
    Thanks for your response.
    The key-listval does'nt seem to firing.
    When I run the form the lov comes up but displays the value 2 which is from the default record group(select 1 "dno", 2 "ename" from dual).
    This is the code in my key-listval -
    DECLARE
    rg_name VARCHAR2(40) := 'name_rg';
    rg_id RecordGroup;
    gc_id GroupColumn;
    errcode NUMBER;
    BEGIN
    rg_id := Find_Group(rg_name);
    IF Id_Null(rg_id) THEN
    rg_id := Create_Group(rg_name);
    gc_id := Add_Group_Column(rg_id, 'dno',
    CHAR_COLUMN,10);
    gc_id := Add_Group_Column(rg_id, 'empno',
    CHAR_COLUMN,100);
    END IF;
         :parameter.p_dno := ''''||replace(:parameter.p_dno,',',''',''')||'''';
    errcode := Populate_Group_With_Query( rg_id,
    'select dno dno, ename ename from emp1 where dno in ('|| :parameter.p_dno|| ')' );
    set_lov_property('name_lov', GROUP_NAME, rg_name);
    list_values;
    message(errcode);
    END;
    Please let me know what I'm doing wrong
    TIA

  • Multiple records one column separated by comma BUT!

    Gurus,
    I'm trying to write a SQL statement to insert multiple records in one column. I'm aware of the multiple String Aggregation Techniques out there BUT ...
    This works like a champ!!!
    select wm_concat(bnuinfc) as emp_id
    from bnu,agr,baz
    where bnunamc = bazbnunamc and
    agrkeyi = bazagrkeyi and
    agrkeyi = 21;
    emp_id
    70348,70111
    But I get errors if I add multiple columns and joins
    select distinct
    katinac ,
    prsvf2c ,
    prsvf18c,
    prsvf19c,
    prsvf20c,
    kvtbezc ,
    artvf9c ,
    artanrc ,
    artvf6c ,
    artbnrc ,
    dokvf3c ,
    prokeyi ,
    probezc ,
    doksnei ,
    pagpags ,
    wm_concat(bnuinfc) as emp_id,
    dokkeyi,
    dokdlad ,
    agrbezc,
    stabezc,
    prsnums,
    systimestamp
    from art,aez,pro,dok,wob,sta,kat,prs,srz,bnu,agr,baz,pag,kvt,kav
    where
    artkeyi = aezartkeyi and
    prokeyi = aezprokeyi and
    aezkavkeyi = artkavkeyi and
    aezkavkeyi = katkavkeyi and
    prokatkeyi = katkeyi and
    kavkvtkeyi = kvtkeyi and
    katkeyi = kavkatkeyi and
    prokavkeyi = katkavkeyi and
    prskavkeyi = artkavkeyi and
    dokkatkeyi = katkeyi and
    wobobjkeyi=dokkeyi and
    pagdokkeyi = dokkeyi and
    prosnei = doksnei and
    prosnli = doksnei and
    UPPER(DOKNLBC) = bnunamc and
    bazagrkeyi = agrkeyi and
    agrkeyi = 21 and
    prokatkeyi = dokkatkeyi and
    probezc <> '---Page element---' and
    wobvarkeyi=dokkavkeyi and
    stakeys=srzstakeys and
    srzrolkeyi = 70 and
    wobstakeys=stakeys and
    prsartkeyi = artkeyi;
    ORA-00937: not a single-group group function - Not really sure how this needs to be done!
    How do I get this to work with mulltiple columns and joins on the bnuinfc column??? Is there a better method?

    Hi,
    Don't use wm_concat. It's undocumented, so it could disappear in the next version of Oracle, or it could do something slightly different, which you might not notice until you've gotten wrong results for months.
    If you like wm_concat, then install and use STRAGG, which you can copy from
    http://asktom.oracle.com/pls/asktom/f?p=100:11:0::::P11_QUESTION_ID:2196162600402
    Stragg seems to do the same thing as wm_concat. (Since wm_concat is undocumented, we can only guess at what it actually does. We can be sure what stragg dioes, and that it will keep doing exactly the same thing if we change versions.)
    Either way, you're calling an aggregate fucntion, so everyhting in your SELECT clause has to be one of the GROUP BY expressions or an aggregate.
    You could make a really big GROUP BY clause, but if you're joining tables, it may be simpler and more efficient to compute stragg in a sub-query, which just uses one table, and then join the results to the other tables.
    I hope this answers your question.
    If not, post a little sample data (CREATE TABLE and INSERT statements, relevant columns only) for all tables, and also post the results you want from that data.
    Explain, using specific examples, how you get those results from that data.
    Simplify the question as much as possible. I'll be you could get a good example of your problem using no more than 5 columns from 2 tables. (If you used scott.emp and scott.dept to illustrate the problem, you wouldn't even have to post sample data.)
    Always say which version of Oracle you're using.

  • How to store multiple records for one master reocrd using sequnce

    dear,
    my question is in one form i have master block f and detail block.
    my question is i created one sequence and assign to master table. but i dont know how to assign that sequence to multiple record in detail table for that particular master record. i got lots of answer previously but i m not getting exactly.pls tell me full procedure otherwise gv me one demo application
    NOTe: the sequnce is created after master record commiting to database.
    PLS pls help me
    Thanks
    damby

    i did not get answer pls help me.

  • How to concatenate multiple records into one

    Hi everybody:
    I want to know if exist some way to concat multiple records into one without using cursors. For example, I have a table named "Authors" like this:
    Lan|Author
    English|Ernest Hemingway
    Spanish|Octavio Paz
    Spanish|Mario Vargas Llosa
    English|Sinclair Lewis
    Spanish|Gabriel García Márquez
    And I want to get this:
    Author
    Octavio Paz, Mario Vargas Llosa, Gabriel García Márquez
    I have worked with SQL Server and I can do something like this:
    CREATE FUNCTION dbo.MyConcat (@lan varchar(10))
    RETURNS varchar(5000) AS
    BEGIN
    declare @retvalue varchar(5000)
    set @retvalue=''
    select @retvalue = @retvalue + Author +',' from Authors where lan = @lan
    return substring(@retvalue,1,len(@retvalue)-1)
    END
    ie, do not use cursors to concatenate records. However, with ORACLE, I have to do someting like this.
    FUNCTION MyConcat(P_Lan IN VARCHAR2) RETURN VARCHAR2 IS
    v_ret VARCHAR2(4000);
    v_element VARCHAR2(4000);
    v_cursor sys_refcursor;
    BEGIN
    OPEN v_cursor FOR SELECT Author FROM Authors where Lan = P_Lan
    LOOP
    FETCH v_cursor INTO v_elemento;
    EXIT WHEN v_cursor%NOTFOUND;
    IF v_ret IS NULL THEN
    v_ret := v_element;
    ELSE
    v_ret := v_ret || ', ' || v_element;
    END IF;
    END LOOP;
    RETURN v_ret;
    END;
    Exist some other way to do this?
    Best Regards
    Jack

    Tks both for answer... I forgot to mention that I am using Oracle 10g. I read about LISTAGG() but this function is available for Oracle 11g release 2.
    I wil read about the other techniques than Hoek mention
    Best Regards.
    Jack

  • Line separator to get multiple records in one variable

    Hi Experts,
    I have a requirement where i need to get data in the below form , in exactly one variable.
    Invoice No.       Inv. Date      Voucher   Gross Amount    TDS Amount     Discount    Paid Amount  
    986013092,17   04/08/2010    00091217   32415.00            .00                 .00          32415.00
    Bharti Infot      27/07/2010     00091230   19600.00            .00                 .00          19600.00
    9860442689    04/08/2010       001247     47374.00            .00                  .00         47374.00
    2031565000,2031565000Total Amount     99389.00             .00                  .00         99389.00
    As of now, I have written the following,
    loop at lt_merge into ls_merge.
      lv_skfbt  = ls_MERGE-SKFBT.
      lv_budat  = Ls_MERGE-budat.
      lv_wskto  = Ls_MERGE-wskto.
      lv_wrbtr  = Ls_MERGE-wrbtr.
      lv_WT_QBSHB = ls_merge-WT_QBSHB.
    concatenate invoice_id
                ls_merge-BELNR
                lv_BUDAT
                ls_merge-XBLNR
                lv_skfbt
                lv_wt_qbshb
                lv_WSKTO
                lv_wrbtr
    into invoice_id separated by space.
    endloop.
    which gives me one row of the table where, invoice_id stores my entire one record as a string. My question is how do I proceed with separating the lines if I have multiple records?
    Thanks in advance..
    Regards,
    Trishna

    HI
    choose some character that will be not use in your data for example '|' vertical separator. You will get string:
    invoice_id  = line1 | line2 | line3 |.....
    loop at lt_merge into ls_merge.
    lv_skfbt = ls_MERGE-SKFBT.
    lv_budat = Ls_MERGE-budat.
    lv_wskto = Ls_MERGE-wskto.
    lv_wrbtr = Ls_MERGE-wrbtr.
    lv_WT_QBSHB = ls_merge-WT_QBSHB.
    concatenate invoice_id
    ls_merge-BELNR
    lv_BUDAT
    ls_merge-XBLNR
    lv_skfbt
    lv_wt_qbshb
    lv_WSKTO
    lv_wrbtr
    into invoice_id separated by space.
    new code
    concatenate  invoice_id '|' into invoice_id
    endloop.

  • One shared mailbox with multiple distribution groups connected and the sent items folder - how to configure?

    Hi!
    I have been struggling for a while now with the following issue.
    For starters:
    We are using exchange 2010 in combination with outlook 2013 on client computers.
    Cause of the limitations concerning the number of mailboxes in outlook im looking for a solution to receive and reply 
    to multiple aliasses. So i did the following:
    1. Configured one shared mailbox.
    2. Configured multiple distribution groups
    3.  made the shared mailbox a member of the distribution groups
    4. Configured full access and send as permissions for myself on the shared mailbox ( testing )
    5. Gave send as permissions to the shared mailbox in Active directory. 
    6.  Logged in to OWA to setup rules for the shared mailbox.
    I now receive emails from all connected distribution groups in the shared mailbox and also in the right folder.
    I do however have to select the proper from address when i reply to an email. 
    the email sent by the main SMTP of the shared mailbox is placed into the sent folder of the shared mailbox. 
    I setup the senddelagate blabla in register.....
    When i sent an email as one of the connected distribution groups it fails to put the sent item in the sent items folder of the shared mailbox. The email is sent using the proper address but placed in the sent folder of my main account. 
    I want this emails to end up in the sent items folder of the shared mailbox. Or even better, in a sent items folder for each of the addresses. 
    Any suggestions ? 
    Thanks in advance!

    Hi,
    As what
    Rajkumar says, sending as a shared mailbox(full access permission) will put the email in the sent item of shared mailbox. But it cannot be located in the “sent item” of a distribution group. Because
    it is a distribution group instead of a enabled user mailbox.
    According to your further description, I understand that the reason why you configure that is some users reached the
    limitation about the number of Exchange accounts you can include in the same Outlook profile. Is it rights? If I misunderstand, please point it out.
    By default, user can only add 10 Exchange accounts to the same profile. You can customize the limit to the number Exchange accounts in the same profile using the following registry data:
    Key: HKEY_CURRENT_USER\software\policies\Microsoft\exchange
    DWORD: MaxNumExchange
    Value: integer value starting at 1 (default = 10 if DWORD is missing)
    http://blogs.technet.com/b/outlooking/archive/2012/12/24/clarification-on-outlook-2010-and-additional-exchange-account-supportability.aspx
    Hope it helps.
    Thanks,
    Winnie Liang
    TechNet Community Support

Maybe you are looking for

  • SSO with SAP R/3 with load balancing as backend over the Web AS

    Hi, we have Netweaver 2004 at this time and we have to connect the portal to a BSP application in a load balancing environment. We set user mapping for the user and set the connection type from SAPLOGONTICKET to UIDPW. This is running for a test envi

  • System Preferences Bluetooth WONT OPEN/ ODD MESSAGE.

    Hi, I just purchased a new wireless keyboard for my iBook G4. When I go into system preferences and click "Keyboard & Mouse" a message appears that says, " Preferences Error- Could not load Keyboard & Mouse." So I tried to then go into bluetooth and

  • Child locked phone which is now disabled. I know the code but don't know how to use it to fix the phone.

    My child locked my iPhone and it is now disabled. I know the correct code but cant figure a way to use it.  The phone says connect to iTunes but when I do that it asks for the code but again, there is no place to input it.  I want to avoid a clean wi

  • Itunes 7.1 not working with my keyboard

    I have a G15 keyboard and when I push play when it is minimized it will not play I have to hold the button down to let it play and when i let go it stops, same goes for when i try and press stop. Does anyone else have the problem and if so did you fi

  • Import media questions

    Device is the Nokia E5-00 and Ovi suite version is 3.1.1.78 Whil;e importign media files, is it possible that:  a. only the files get imported, no folders b. after a successful import, the data is automatically deleted from the phone