Skip to Content
avatar image
Former Member

collect n append

hi all,

i have a situation like

itab1 | itab2

1 | a

2 | b

3 | c

new | a

wat will be the output for append n wat will be the out put for collect

thanks in adfvance

Santosh

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

4 Answers

  • avatar image
    Former Member
    Aug 18, 2007 at 03:32 PM

    Hi,

    Append:

    itab1 | itab2

    1 | a

    2 | b

    3 | c

    new | a

    Collect:

    itab1 | itab2

    1 | a

    2 | b

    3 | c

    new | <----- this record will not come.

    collect will add up the values basedon the same keys

    Append will just append as if as new row.

    Thanks,

    Deepak.

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Aug 18, 2007 at 04:28 PM

    Hi,

    If you append it will append all fields respective all the values in the row are same or not.

    With append if any

    col1 | col 2

    A | 1

    B | 2

    A | 2

    With collect statement the output will be :

    Col1 | Col 2

    A | 3

    B | 2.

    It will add up the integers 1 and 2 coz, A is common for these two rows.

    Thanks,

    Sri

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Aug 18, 2007 at 07:55 PM

    Hi ravulapalli santosh,

    did you

    - just try what happens?

    - press F1 on COLLECT in editor?

    Regards,

    Clemens

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Aug 19, 2007 at 05:19 AM

    In your case with this data.. both append and collect will hhave the same 4

    records.

    Collect will consolidate the numeric fields based on the unique ness of the remanining fields.. for example say

    fld1 fld 2

    a 1

    b 2

    c 3

    b 4

    with above data..

    collect will hhave a 1,b 6 and c 3 where as append will have all the four records.

    Thaks

    Mahesh

    Add comment
    10|10000 characters needed characters exceeded