Doubt in concatenating strings

Hi all,
Am concatenating two strings and i want space of 10 characters.
If i use concatenate text1 text2 into text3 separated by space
it is dispalying as : text1 text2
But my requirement is to display text with gap of 10 characters
::::::text1                               text2

Hello,
If u want to use it in ALV then u should do like this.
I have did the same thing for TOP_OF_PAGE do the same for end_OF list
GO therough this code..
  CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
       EXPORTING
            I_CALLBACK_PROGRAM          = IT_VARIANT-REPORT
<b>            I_CALLBACK_HTML_TOP_OF_PAGE = 'TOP_OF_PAGE'</b>     <b>Herechange to END_OF_LIST</b>        IT_FIELDCAT                 = IT_FIELDCAT
            I_SAVE                      = 'A'
            IS_VARIANT                  = IT_VARIANT
            IT_EVENTS                   = IT_EVENTS
       TABLES
            T_OUTTAB                    = G_T_OUTTAB
       EXCEPTIONS
            PROGRAM_ERROR               = 1
            OTHERS                      = 2.
FORM TOP_OF_PAGE USING CL_DD TYPE REF TO CL_DD_DOCUMENT.    "#EC *
  DATA: L_F_INFO(255).
  DATA: LV_COUNT TYPE SDYDO_TEXT_ELEMENT,
        LV_PER TYPE SDYDO_TEXT_ELEMENT,
        LV_NUMC(8) TYPE N.
  CALL METHOD CL_DD->ADD_TEXT
    EXPORTING
      TEXT         = TEXT-008
      SAP_STYLE    = CL_DD_DOCUMENT=>SMALL
      SAP_COLOR    = CL_DD_DOCUMENT=>LIST_HEADING_INT
      SAP_FONTSIZE = CL_DD_DOCUMENT=>SMALL
      SAP_EMPHASIS = CL_DD_DOCUMENT=>STRONG
      STYLE_CLASS  = SPACE.
  CALL METHOD CL_DD->NEW_LINE
    EXPORTING
      REPEAT = 1.
  CALL METHOD CL_DD->ADD_GAP
    EXPORTING
      WIDTH = 25.
  CALL METHOD CL_DD->ADD_TEXT
    EXPORTING
      TEXT         = TEXT-009
      SAP_STYLE    = CL_DD_DOCUMENT=>SMALL
      SAP_COLOR    = CL_DD_DOCUMENT=>LIST_HEADING_INT
      SAP_FONTSIZE = CL_DD_DOCUMENT=>SMALL
      SAP_EMPHASIS = CL_DD_DOCUMENT=>STRONG
      STYLE_CLASS  = SPACE.
  CALL METHOD CL_DD->ADD_GAP
    EXPORTING
      WIDTH = 10.
  CALL METHOD CL_DD->ADD_TEXT
    EXPORTING
      TEXT         = TEXT-010
      SAP_STYLE    = CL_DD_DOCUMENT=>SMALL
      SAP_COLOR    = CL_DD_DOCUMENT=>LIST_HEADING_INT
      SAP_FONTSIZE = CL_DD_DOCUMENT=>SMALL
      SAP_EMPHASIS = CL_DD_DOCUMENT=>STRONG
      STYLE_CLASS  = SPACE.
  CALL METHOD CL_DD->ADD_GAP
    EXPORTING
      WIDTH = 11.
  CALL METHOD CL_DD->ADD_TEXT
    EXPORTING
      TEXT         = TEXT-011
      SAP_STYLE    = CL_DD_DOCUMENT=>SMALL
      SAP_COLOR    = CL_DD_DOCUMENT=>LIST_HEADING_INT
      SAP_FONTSIZE = CL_DD_DOCUMENT=>SMALL
      SAP_EMPHASIS = CL_DD_DOCUMENT=>STRONG
      STYLE_CLASS  = SPACE.
  CALL METHOD CL_DD->ADD_GAP
    EXPORTING
      WIDTH = 15.
Hope this will be help ful for u.
If useful reward.
Vasanth

Similar Messages

  • Function - Return More than One Value in a Concatenated String

    Hi,
    Is it possible for a function to return a concatenated string(combining more than one number). I am trying to return the PO number by inputting and invoice_id and code number but an invoice_id can have more than one PO with the same code number. I would like to concatenate the PO numbers with commas e.g.
    10124, 10090, 10987
    At the moment the function returns null for these cases that have more than one PO number.
    Thanks

    Also is is possible to create another function that can be called in the same script using the PO number as an IN parameter in SQL. See SQL below:
    select cck.concatenated_segments as "Segment" ,
    cc.code_combination_id,
    NVL ( src . user_je_source_name , '**********' ) AS "Source" ,
    NVL ( cat . user_je_category_name , '**********' ) AS "Category" ,
    jel . period_name as "Period Name" ,
    i.invoice_id as "Invoice ID",
    s.vendor_name as "Vendor Name",
    s.segment1 as "Supplier No",
    jeb . name as "Batch Name" ,
    func_get_po(i.invoice_id, cc.code_combination_id) "PO No",
    jeh . name AS "Header Name" ,
    jel . description AS "Description" ,
    jel.accounted_dr AS "Debit" ,
    jel.accounted_cr AS "Credit" ,
    NVL(jel.accounted_dr, 0) - NVL(jel.accounted_cr, 0) AS "Net Amount"
    FROM apps.gl_code_combinations cc ,
    apps.gl_code_combinations_kfv cck,
    apps.gl_je_lines jel ,
    apps.gl_je_headers jeh ,
    apps.gl_je_batches jeb ,
    apps.gl_je_categories cat ,
    apps.gl_je_sources src,
    apps.gl_import_references r,
    apps.xla_ae_lines al,
    apps.xla_ae_headers ah,
    apps.xla_events e,
    xla.xla_transaction_entities te,
    apps.ap_invoices_all i,
    apps.ap_suppliers s
    WHERE ( cck.concatenated_segments BETWEEN '23.83545.141.000.00.23.000.000' AND '23.83545.141.000.00.23.000.000'
    AND cc.CHART_OF_ACCOUNTS_ID = 50328
    AND jeh.LEDGER_ID IN
    (select acc.ledger_id
    FROM apps.gl_access_set_ledgers acc
    WHERE acc.access_set_id = 1000
    AND jel.code_combination_id = cc.code_combination_id
    AND cck.code_combination_id = cc.code_combination_id
    AND jel.status
    || '' = 'P'
    AND ( jel.accounted_dr != 0
    OR jel.accounted_cr != 0 )
    AND jeh.je_header_id = jel.je_header_id
    AND jeh.actual_flag = 'A'
    AND 1 = 1
    AND jeh.currency_code != 'STAT'
    AND jeb.je_batch_id = jeh.je_batch_id
    AND jeb.average_journal_flag = 'N'
    and src.je_source_name = jeh.je_source
    and cat.je_category_name = jeh.je_category
    and r.je_header_id(+) = jel.je_header_id
    and r.je_line_num(+) = jel.je_line_num)
    AND ( :period_name = jel.period_name
    and al.gl_sl_link_id(+) = r.gl_sl_link_id
    and al.ae_header_id = ah.ae_header_id(+)
    and al.application_id = ah.application_id(+)
    and ah.application_id = e.application_id(+)
    and ah.event_id = e.event_id(+)
    and e.application_id = te.application_id(+)
    and e.entity_id = te.entity_id(+)
    and nvl(te.source_id_int_1,-99) = i.invoice_id(+)
    and i.vendor_id = s.vendor_id(+) )
    AND ( jel.ledger_id = 2041)
    ORDER BY src.user_je_source_name ,
    cat.user_je_category_name ,
    jeb.name ,
    jeh.name ,
    cck.concatenated_segments ,
    jel.je_line_num
    I am using func_get_po(i.invoice_id, cc.code_combination_id), I would like to call another function in this script that uses the PO number as an IN parameter.
    For example func_get_po_requester(i.invoice_id, cc.code_combination_id, func_get_po(i.invoice_id, cc.code_combination_id))
    Would this work?
    Thanks

  • Using Javascript to create concatenated string from checkbox fields to one text field

    Hi. I have a PDF form that I am trying to have output to a spreadsheet that matches my database schema. Here is the dilemna:
    * I have a set of checkboxes for available languages (LANGUAGE_ENGLISH, LANGUAGE_SPANISH, etc.) When they export to spreadsheet, the value is TRUE.
    * I need to take values from checked boxes and create a single string in a text field called LANGUAGE_DISPLAY (so my UI will not need to do the concatenation). If LANGUAGE_ENGLISH is TRUE (checked), append "English, " to LANGUAGE_DISPLAY, else append "". Then, if LANGUAGE_SPANISH is TRUE (checked), append "Spanish, " to LANGUAGE_DISPLAY, else append "". And on and on
    In the LANGUAGE_DISPLAY text field properties, I am inserting a Custom Calculation script to try to achieve this, but am not getting any results. I tried teh following even trying to pull the checkboxes default values and string them together:
    box1 = this.getField("LANGUAGE_ENGLISH").value.toSrting();
    box2 = this.getField("LANGUAGE_FARSI").value.toSrting();
    box3 = this.getField("LANGUAGE_MANDARIN").value.toSrting();
    event.value = box1 + ', ' + box2 + ', ' + box3;
    I also played with this to get the desired strings output...but to no avail:
    if ( LANGUAGE_ENGLISH.rawValue == true )
    box1.rawValue = "English, ";
    if ( LANGUAGE_FARSI.rawValue == true )
    box1.rawValue = "Farsi, ";
    if ( LANGUAGE_HEBREW.rawValue == true )
    box1.rawValue = "Hebrew, ";
    event.value = box1 + box2 + box3;
    Then I tried to simplify to see one field output so used this script...still no results:
    event.value = "";
    var f = this.getField("LANGUAGE_ENGLISH");
    if ( f.isBoxChecked() == true) {
    event.value = "English";
    Couple questions:
    1) Am I on the right track with any of these scripts?
    2) Is there something else I need to do to get the script to run before running the Create Spreadsheet with Data Files comman in Acrobat to get my csv file output? Maybe there needs to be some event to get the checkbox values read by that field in order to calculate/create the string.
    Appreciate any help you can provide.

    LiveCycle Designer has shipped with all Acrobat Professional versions since the "Professional" version was introduced with version 6.
    You do not let us know want results you get in the field or the JavaScript console.
    Using:
    box1 = this.getField("LANGUAGE_ENGLISH").value.toString();
    box2 = this.getField("LANGUAGE_FARSI").value.toString();
    box3 = this.getField("LANGUAGE_MANDARIN").value.toString();
    event.value = box1 + ', ' + box2 + ', ' + box3;
    returns "Off, Off, Off", when no box is checked and returns "Yes" for the appropriate box being checked when the default value is used for the creation of the check box. So if one would make the 'Export Value' of the box from the default value of 'Yes" to the appropriate language, one would get a more desirable result. But for each unchecked box the value would appear as "Off". So one needs to change the 'Off' value to a null string. But one is still left with the separator when there is an unchecked option.
    Using the following document level function:
    // Concatenate 3 strings with separators where needed
    function fillin(s1, s2, s3, sep) {
    Purpose: concatenate up to 3 strings with an optional separator
    inputs:
    s1: required input string text or empty string
    s2: required input string text or empty string
    s3: required input string text or empty string
    sep: optional separator sting
    returns:
    sResult concatenated string
    // variable to determine how to concatenate the strings
    var test = 0; // all strings null
    var sResult; // re slut string to return
    // force any number string to a character string for input variables
    s1 = s1.toString();
    s2 = s2.toString();
    s3 = s3.toString();
    if(sep.toString() == undefined) sep = ''; // if sep is undefined force to null
    assign a binary value for each string present
    so the computed value of the strings will indicate which strings are present
    when converted to a binary value
    if (s1 != "") test += 1; // string 1 present add binary value: 001
    if (s2 != "") test += 2; // string 2 present add binary value: 010
    if (s3 != "") test += 4; // string 3 present add binary value: 100
    /* return appropriate string combination based on
    calculated test value as a binary value
    switch (test.toString(2)) {
    case "0": // no non-empty strings passed - binary 0
    sResult = "";
    break;
    case "1": // only string 1 present - binary 1
    sResult = s1;
    break;
    case "10": // only string 2 present - binary 10
    sResult = s2;
    break;
    case "11": // string 1 and 2 present - binary 10 + 1
    sResult = s1 + sep + s2;
    break;
    case "100": // only string 3 present - binary 100
    sResult = s3;
    break;
    case "101": // string 1 and 3 - binary 100 + 001
    sResult = s1 + sep + s3;
    break;
    case "110": // string 2 and 3 - binary 100 + 010
    sResult = s2 + sep + s3;
    break;
    case "111": // all 3 strings - binary 100 + 010 + 001
    sResult = s1 + sep + s2 + sep + s3;
    break;
    default: // any missed combinations
    sResult = "";
    break;
    return sResult;
    And the following cleaned up custom calculation script:
    box1 = this.getField("LANGUAGE_ENGLISH").value;
    box2 = this.getField("LANGUAGE_FARSI").value;
    box3 = this.getField("LANGUAGE_MANDARIN").value;
    if (box1 == 'Off') box1 = '';
    if (box2 == 'Off') box2 = '';
    if (box3 == 'Off') box3 = '';
    event.value = fillin(box1, box2, box3, ', ');
    One will get the list of languages with the optional separator for 2 or more language selections.

  • Splitting a concatenated string to multiple cells in a row in BIP Reports

    Hello Experts,
    Let me how to split a concatenated string into multiple cells in BIP reports rtf.
    Ex:
    string: acg;ghdf;tesrlkjj;hvfffda
    has to placed in multiple cells like
    string1: acg
    string2: ghdf
    string3: tesrlkjj
    string4: hvfffda
    Appreciate your quick reply.
    Please drop in the pseudo code.
    Thanks & Regards
    Syed

    The report is based on a standard sql query such as
    select item1, item2, item3, item4, item5, item6, item7
    from mytable
    order by item1Wanted to put that in as I am not using an interactive report.
    Thanks
    Wally

  • Concatenating strings to form an INSERT INTO

    I am trying to build an insert statement by concatenating
    strings. Basically, this is what I'm doing:
    <cfset string1 = "INSERT INTO #tablename# (">
    <cfset string1 = string1 & #colname#>
    <cfset string1 = string1 & ") ">
    <cfset string2 = "VALUES ('">
    <cfset string2 = string1 & #coldata#>
    <cfset string2 = string1 & "') ">
    <cfquery name="insert" datasource="db">
    #string1##string2#
    </cfquery>
    So if I exchange the <cfquery> tags for
    <cfoutput> I get a valid INSERT statement:
    INSERT INTO Habitat (AREA, ARTID, BIOTOP) VALUES (43, 37,
    'text')
    But when I have the <cfquery> tag I get this error:
    Syntax error (missing operator) in query expression
    '''text'''.
    I have tried changing the ('#coldata#') to (''#coldata'') and
    also tried ("#coldata#") and (""#coldata#"") but I get errors all
    the time...
    So. How do I do this?

    quote:
    Originally posted by:
    Newsgroup User
    To build the form - even dynamically - you need to know what
    you're
    building, so you have that information at the time you're
    adding your form
    fields. You know the order the fields are displayed, the data
    types and
    business rules (you say you're validating the values), and
    the input
    controls used to capture the data.
    Ditto you *must* know the structure of the table you're
    storing the data
    in
    Hehe, looks like someone got a bit curious. ;-)
    I do know a few things. I have a base table that contains a
    column with the table-names of all tables which are part of the
    application. Whenever a new table is created, it is added to this
    list so it can be loaded with all the others.
    I have a form that loads tables with their structures from
    the database, and lets the user change both column names,
    datatypes, table names, whatever... Assuming of course that the
    existing data in the table doesn't conflict with the proposed
    change. All form elements are given names from table-names or
    column-names and datatype from the database stored alongside.
    Tricky thing was to make sure the "insert into" gets the right
    columns and values for that table since the form items are thrown
    out in any order and multiple tables are treated in the same form.
    But now I got it all figured out. :-)

  • Can a Xquery return a concatenated string and an XML element

    Hi,
    My Xquery fucntion is shown below:
    It accepts 4 string parameters and an XML element i.e., $Message which is an XML element(request coming to the service) and i need to log all this information to a log file.
    I am using the below concat fucntion to get a concatenated string of all the parameters but, for $Message i m not able to get the XML payload. How to achieve the same in the Xquery?
    *$Message is the below XML file:*
    <payload>
    <aa>one</aa>
    <bb>two</bb>
    <cc>three</cc>
    </payload>
    My Xquery function is:
    declare function xf:XformLog($Name as xs:string,
    $id as xs:string,
    $Context as xs:string,
    $Annotation as xs:string,
    $Message as element(*))
    as xs:string {
    concat("Name = ",$Name," , ","Id = ",$id," , ","Message Context = ",$Context," , ","Annotation = ",$Annotation," , ","Event Message = ", data($Message/@* , $Message/node()))
    I am trying to achieve the following log:
    Name = xyz, Id = 111, Message Contact = abc, Annotation = ggg, Event Message = <payload>
    <aa>one</aa>
    <bb>two</bb>
    <cc>three</cc>
    </payload>
    How can i achieve the same. Please suggest.
    Thanks in advance.
    Edited by: user9223904 on Mar 18, 2013 3:16 AM

    Hi,
    You have to use a serialization function to convert the element instance to a string.
    Such functionality is not included in the XQuery standard but many implementors provide an extension to do so.
    For example, in OSB, you can use <tt>fn-bea:serialize()</tt>.
    What's your environment and XQuery engine?

  • Inserting carriage returns in a concatenated string

    Hi.....
    Does anyone know how to insert carriage returns within a concatenated string in a sql statement?
    i.e. Select 'John'||'Smith' from dual
    I'm trying to return:
    John
    Smith
    as opposed to John Smith
    Thanks,
    ~Christine

    As suggested chr(10) is what you need, but it's not carriage return, but line feed, carriage return is chr(13). See the difference :
    TEST@db102 SQL> select 'John'||chr(10)||'Smith' from dual;
    'JOHN'||CH
    John
    Smith
    TEST@db102 SQL> ed
    Wrote file afiedt.buf
      1* select 'John'||chr(13)||'Smith' from dual
    TEST@db102 SQL> /
    'JOHN'||CH
    Smith
    TEST@db102 SQL>                                                              

  • Removing segment from the concatenated String...

    Hi,
    please any one tell me that what will be the query to separate segments from the concatenated string.
    For instance, if the segment value passed is
    ‘000-000-abcd-10001-post-000-21000’, then the following output should get displayed.
    000
    000
    abcd
    10001
    post
    000
    21000
    Thanks in advanced

    test it:
    with
      test_table as
          select '000-000-abcd-10001-post-000-21000' as str from dual union all
          select '111-222-cdef-20002-test' as str from dual
    select v.str,
           substr( my_str,
                   instr(my_str,'-',1, rn) + 1,
                   instr(my_str,'-',1, rn + 1) -  instr(my_str,'-',1, rn) - 1
                 ) as new_str
      from (
             select '-'||ltrim(rtrim(str,'-'),'-')||'-' as my_str,
                    str
                 from test_table
           ) v,
             select level as rn
                 from dual,
                        select max(length(str) - length(replace(str,'-'))) max_len from test_table
              connect by level <= max_len + 1
            ) pivot
    where (length(str) - length(replace(str,'-'))) + 1 >= rn
    order by str, rn
    Query finished, retrieving results...
                   STR                   NEW_STR
    000-000-abcd-10001-post-000-21000    000
    000-000-abcd-10001-post-000-21000    000
    000-000-abcd-10001-post-000-21000    abcd
    000-000-abcd-10001-post-000-21000    10001
    000-000-abcd-10001-post-000-21000    post
    000-000-abcd-10001-post-000-21000    000
    000-000-abcd-10001-post-000-21000    21000
    111-222-cdef-20002-test              111
    111-222-cdef-20002-test              222
    111-222-cdef-20002-test              cdef
    111-222-cdef-20002-test              20002
    111-222-cdef-20002-test              test
    12 row(s) retrieved

  • ORA-01591: lock held by in-doubt distributed transaction string  error

    Hi Gurus,
    I am getting the error
    ORA-01591: lock held by in-doubt distributed transaction string error while running once procedure.
    Procedure basically inserts 2 tables and update 1 table.
    The order of execution is given below.
    However I get the error as table _a locked.
    Can you please help me how to handle this ?
    Begin
    Insert into table_a values (values1, value2); -- (our DB)
    Insert into table_b@remote_DB values (value1, value2); --( REMOTE DB)
    update table C ; -- (our DB)
    commit; -- when I debugged I get exception with the sql error above in this commit.
    End;

    Tina wrote:
    Hi Gurus,
    I am getting the error
    ORA-01591: lock held by in-doubt distributed transaction string error while running once procedure.
    Procedure basically inserts 2 tables and update 1 table.
    The order of execution is given below.
    However I get the error as table _a locked.
    Can you please help me how to handle this ?
    Begin
    Insert into table_a values (values1, value2); -- (our DB)
    Insert into table_b@remote_DB values (value1, value2); --( REMOTE DB)
    update table C ; -- (our DB)
    commit; -- when I debugged I get exception with the sql error above in this commit.
    End;
    01591, 00000, "lock held by in-doubt distributed transaction %s"
    // *Cause:  Trying to access resource that is locked by a dead two-phase commit
    //          transaction that is in prepared state.
    // *Action: DBA should query the pending_trans$ and related tables, and attempt
    //          to repair network connection(s) to coordinator and commit point.
    //          If timely repair is not possible, DBA should contact DBA at commit
    //          point if known or end user for correct outcome, or use heuristic
    //          default if given to issue a heuristic commit or abort command to
    //          finalize the local portion of the distributed transaction.

  • Easy Question: How to split concatenated string into multiple rows?

    Hi folks,
    this might be an easy question.
    How can I split a concatenated string into multiple rows using SQL query?
    INPUT:
    select 'AAA,BBB,CC,DDDD' as data from dualDelimiter = ','
    Expected output:
    data
    AAA
    BBB
    CCC
    DDDDI'm looking for something kind of "an opposite for 'sys_connect_by_path'" function.
    Thanks,
    Tomas

    Here is the SUBSTR/INSTR version of the solution:
    SQL> WITH test_data AS
      2  (
      3          SELECT ',' || 'AAA,BBB,CC,DDDD' || ',' AS DATA FROM DUAL
      4  )
      5  SELECT  SUBSTR
      6          (
      7                  DATA
      8          ,       INSTR
      9                  (
    10                          DATA
    11                  ,       ','
    12                  ,       1
    13                  ,       LEVEL
    14                  ) + 1
    15          ,       INSTR
    16                  (
    17                          DATA
    18                  ,       ','
    19                  ,       1
    20                  ,       LEVEL + 1
    21                  ) -
    22                  INSTR
    23                  (
    24                          DATA
    25                  ,       ','
    26                  ,       1
    27                  ,       LEVEL
    28                  ) - 1
    29          )       AS NEW_STRING
    30  FROM    test_data
    31  CONNECT BY LEVEL <= LENGTH(REGEXP_REPLACE(DATA,'[^,]','')) - 1
    32  /
    NEW_STRING
    AAA
    BBB
    CC
    DDDD

  • Calculated attribute: Concatenated String not possible ?

    Hi,
    whats the syntax to make a concatenated String view in a calculated attribute of an analytical view ?
    For Example in metasyntax:
    <CONST> = 'EDF'
    CHANNEL_DESCRIPTION  = 'Internet'
    <CONST> || CHANNEL_DESCRIPTION  =  'EDF Internet'
    Is this possible ?
    How ?
    ThanXs
    Martin

    Hi,
    You can use the "+" operator to concat two strings.This will call the CONCAT function of NewDB Engine to concatenate the strings.
    (String1 + String2 in a Calc Attribute)
    Rgds,
    Murali

  • No Auto-concatenated strings in a (For / While) Loop ?

    I saw that "auto-concatenated" was added to the Tunnel-mode of a For Loop.  I was positively surprised as it looked very convenient to put it directly into use.  However, the string characters I wanted to concatenate caused an error.  Upon looking closer at this recently added feature I saw that it could concatenate arrays only.  Of course I can convert the string into a byte array and (afterwards) back again, but it seemed an omission which might be added in a new Labview version.

    Hi Ettepet,
    my picture is a snippet.
    Btw. that function is ConcatenateStrings...
    @Neos:
    You surely can concatenate arrays of varying length in the loop. So that shouldn't be the problem. Concatenation is memory-inefficient anyway, regardless of using a (new) output tunnel or the "traditional" way of BuildArray or ConcatString...
    Best regards,
    GerdW
    CLAD, using 2009SP1 + LV2011SP1 + LV2014SP1 on WinXP+Win7+cRIO
    Kudos are welcome

  • Returning concatenated string for each acctid

    Hi All,
    For each acct id, bank statement can be sent to multiple CC EMAIL addresses.
    So, for each acct - only one row should appear. I would need to string together cc email addreses for each acct.
    Can someone provide code for a function that takes acct_id and loops through all the CC email addresses and for each ACCT_ID passed and returns a concatenated result of
    email addresses like "email1, email 2".
    GIVEN TABLE:
    ACCT EMAIL ADDRESS:
    ACCT1 [email protected]
    ACCT1 [email protected]
    RESULT in report:
    ACCT1 [email protected], [email protected]
    Need to do it asap.
    Regards,

    Version? If you are on 11.2 use LISTAGG:
    select  acct,
            listagg(email_address,', ') within group(order by email_address) email_address_list
      from  ypour_table
      group by acct
    /For example:
    with sample_table as (
                          select 'ACCT1' ACCT,'[email protected]' EMAIL_ADDRESS from dual union all
                          select 'ACCT1','[email protected]' from dual
    select  acct,
            listagg(email_address,', ') within group(order by email_address) email_address_list
      from  sample_table
      group by acct
    ACCT  EMAIL_ADDRESS_LIST
    ACCT1 [email protected], [email protected]
    SQL> On lower versions:
    select  acct,
            rtrim(xmlagg(xmlelement(e,email_address,', ').extract('//text()') order by email_address),', ') email_address_list
      from  your_table
      group by acct
    /For example:
    with sample_table as (
                          select 'ACCT1' ACCT,'[email protected]' EMAIL_ADDRESS from dual union all
                          select 'ACCT1','[email protected]' from dual
    select  acct,
            rtrim(xmlagg(xmlelement(e,email_address,', ').extract('//text()') order by email_address),', ') email_address_list
      from  sample_table
      group by acct
    ACCT  EMAIL_ADDRESS_LIST
    ACCT1 [email protected], [email protected]
    SQL>SY.

  • Can SQL*Loader Insert concatenated string into table

    Hi All,
    I want to insert a column, whose format is "abc" + to_char(sysdate,'YYYYMMDD'), into temp table. How can I do it? Thank you in advance.
    Best Regards,
    Sheng

    Hi Lukasz,
    Thank you for your help! The "abc" is a constant string, it isn't a column. And I use concat function to solve the problem. like this
    LOAD DATA
    INFILE data.txt
    INTO TABLE tmp_table
    fields terminated by "," optionally enclosed by '"'
    ( c1 "concat('abc',TO_CHAR(SYSDATE, 'YYYYMMDD'))"
    Sheng
    Edited by: Sheng on 2013-5-26 下午4:44

  • Breaking down a concatenated string

    Hi mates
    I have a requirement where i have to breakdown a string for ex: AV86140-(AV86140_BB+AV86140_TB) into three different properties (Account1, Account2 and Account3).
    Expected scenario,
    Account1 = AV86140
    Account2 = AV86140_BB
    Account3 = AV86140_TB
    The issue is the lengths of the property values will vary, so i cannot hard code lengths in the Substring function based on the position of '-' or '+'.
    I worked out Account1... Account2/3 is the issue.
    Can anybody help me on this please?
    Many Thanks
    VJ

    Hi Cable Summers/Ramesh
    Many thanks for responding.
    That is the description of a node. I need to use that description string to break it down into three values and store it in three properties.
    Account1 is easier as it has the first part of the string and i used the SubString/Pos function to get the exact length from the first character (not hard coded).
    It is the second and the third properties that are an issue as the description string length is not constant and can change (second and third parts of the description can be longer).
    Cheers
    VJ

Maybe you are looking for

  • Clone Stamp Selection Failure in CS6

    I try using the clone stamp but selection fails with this error message: Could not use the clone stamp because the area to clone has not been defined (Alt-click to define source point). When I press Alt, I see the characteristic selection bullseye. B

  • Need Help regarding which Material Type to use for the Scenario

    Hi, Here we are configuring the service scenario. Suppose Electric Switch of customer flat is not working. Here in this case I will purchase the switch. And along with service order I will do the delivery of the Material. Then will raise the Invoice

  • Condition type in tax and pricing

    Hello Guru's I have a purchase order in which  tax is say X7 for which condition type is appearing as MWVZ in taxes but in condition tab condition type is appearing as NAVS.Can any one tell how to check mapping of condition type appearing in taxes wi

  • Software in CD or DVD format

    I would like to get this software in CD or DVD format.

  • Creation Sign on AR Transaction Type

    Hi All, This is regarding the Creation Sign on the AR transaction type setup in AR. This sign determines the allowed sign of the total amount of Invoices or Credit Memos. Is it possible to have this funcitionality at the Invoice Line level? Thanks.