Wm_concat function

Hi
I am using Oracle 11g, and I have a question regarding the following.
I have a table with the following data
Name Category Value
AA 01 012
AA 02 63-123
BB 01 012
BB 02 63-114
BB 03 55
CC 01 088
DD 01 088
DD 02 63-145
DD 03 65
I need to extract the data in the following format
Name 01 02 03
AA 012 63-123
BB 012 63-114 55
CC 088
DD 088 63-145 65
How should I go about doing this?
I tried using the wm_concat function, then using substr to extract each item, but the wm_concat function will extract some rows in the sequence (01,02,03), and other rows in the sequence (01,03,02). What can I do?
Thanks.

Hi,
You can use LISTAGG function.
SQL> WITH t AS (
  2  SELECT 'AA' name, 01 category, '012' value FROM dual UNION ALL
  3  SELECT 'AA' name, 02 category, '63-123' value FROM dual UNION ALL
  4  SELECT 'BB' name, 01 category, '012' value FROM dual UNION ALL
  5  SELECT 'BB' name, 02 category, '63-114' value FROM dual UNION ALL
  6  SELECT 'BB' name, 03 category, '55' value FROM dual UNION ALL
  7  SELECT 'CC' name, 01 category, '088' value FROM dual UNION ALL
  8  SELECT 'DD' name, 01 category, '088' value FROM dual UNION ALL
  9  SELECT 'DD' name, 02 category, '63-145' value FROM dual UNION ALL
10  SELECT 'DD' name, 03 category, '65' value FROM dual)
11  SELECT name, LISTAGG(VALUE, '  ') WITHIN GROUP (ORDER BY value)
12    FROM t
13   GROUP BY name
14  /
NAME LISTAGG(VALUE,'')WITHINGROUP(O
AA   012  63-123
BB   012  55  63-114
CC   088
DD   088  63-145  65
SQL> Solution by Dbb is perfect as per your requirement as you want rows in different columns.
Regards
Ameya
Edited by: Ameya on Apr 20, 2011 1:02 AM

Similar Messages

  • WM_CONCAT function from which version do you support

    Oracle 11.2 version is being used.
    "WM_CONCAT" function available?

    user2364195 wrote:
    Oracle 11.2 version is being used.
    "WM_CONCAT" function available?WM_CONCAT is an Un-documented function, and its use is discouraged.
    When in 11.2, you have LISTAGG, which is a documented function and any change in the function, is notified as opposed to WM_CONCAT. Hence, I will recommend you the LISTAGG instead of un-documented features.
    Read Here for more information

  • Compiling WM_CONCAT function in Oracle database

    There is something that I wanted to know about Wm_concat. I read it one of the posts across the forum, that wm_concat, being a non-documented function, isn't installed in a particular database and user can possibly install it later(wm_concat fucntion not wrking in 11g...
    I came across another post that had some source code for doing the same(wm_concat fucntion not wrking in 11g...
    code:
    SQL> CREATE OR REPLACE
    type WM_CONCAT_IMPL wrapped
    a000000
    1
    abcd
    abcd
    abcd
    abcd
    abcd
    abcd
    abcd
    abcd
    abcd
    abcd
    abcd
    abcd
    abcd
    abcd
    abcd
    d
    270 160
    bg9hz+fBwa888VEZGViHFs/oOP0wg433f64df3QCWE7VehmhTFcUe3y+JrsniV3cSuvmnE3g
    Y93dtR+cCsU1N+UQDGbtzhCf2HIdr8lPzfgF2bmCTvmGlHQbTAjTftNrDq3p093ncwb32OyX
    3ZFDTeH2jpjm3uWYyT8kZBfJIYxRwgLfRApoW32cpy0eRnvDBt2XfTAMXKCSNnqSoTiGA83W
    6deKW+rWyBu9L/EPyFkmQZeBncNsiNDF8fa1Sm6vdQiEanlCQnaPJ11a0na8hK6psDSaey+x
    fdMupCwSvg6gMrSV4QCguhOCqW2AmxRVMqpXJootPpTBxBFZc7hORGbriUI=
    Type created.
    SQL> CREATE OR REPLACE function wm_concat wrapped
    a000000
    1
    abcd
    abcd
    abcd
    abcd
    abcd
    abcd
    abcd
    abcd
    abcd
    abcd
    abcd
    abcd
    abcd
    abcd
    abcd
    8
    58 96
    CuW1MAfZPVR6NOnXKVmXY2o9pswg8eZgcfLCNLXhZy8K7/cgzcVrPnfMPnx3TAM7h0ZSXD
    j57Asr2ym9ZtFldFmFu+RdpAU8VGORKSvtVG+DmAOR4C+NTa+Pit2kDbEpI5zhZUgqameSkE
    DQ==
    Function created.
    I wanted to know, if this solution of compiling the above code works well. Also, iis wm_concat not supported in 11g?

    WM_CONCAT is still an undocumented function and shouldn't be used. If you're on 11g then you can use the new (and supported) LISTAGG function which works better anyway.
    DO NOT USE undocumented functionality, even if you've obtained the wrapped source code for it (how do you know that's not some fake code someone's wrapped that could cause malicious damage?)
    Even Tom Kyte tells you not to use undocumented functions such as WM_CONCAT
    Re: DISTINCT not working with  wmsys.wm_concat

  • Refining SQL Replacement for Oracle's WM_CONCAT Function (Pivoting Rows to column)

    Greetings,
    I am moving a query from Oracle SQL to Microsoft SQL and am having some difficulty with the transition. Part of my code (listed here) used to pivot the data and display RESULT_VALUE 
    by the CPI_SEQ . In Oracle this was easy to do by using the function: WM_CONCAT.
    I have been ‘Googling’ for the non-Oracle way to achieve this and stumbled on to the “STUFF((SELECT…)”
     method. This almost works for me except that it places everything into one cell, whereas
     I need to concatenate  RESULT_VALUE by CPI_SEQ (the CPI_SEQ is the unique ID). The current code gives me this:
    RESULTS
    Anxiety, Depression, Diabetes, 
    COPD, ARDS
    Whereas I want  my code to present it this way instead
    CPI_SEQ                              
    RESULTS
    22                                          
    Anxiety, Depression
    44                                          
    Diabetes
    46                                          
    COPD, ARDS
    SELECT (STUFF((SELECT ',' + RESULT_VALUE
    FROM
    SELECT DISTINCT
    C1.CPI_Seq AS CPI_SEQ,C1.Result_Value AS RESULT_VALUE
    ,count(FCurrent.Field_Name) "Current"
    ,count(FPast.Field_Name) "Past"
    ,Count(*) Count
    ,CASE
    When count(FCurrent.Field_Name) > 0 and count(FPast.Field_Name) >0 and count(Fcurrent.Field_Name)+ count(FPast.Field_Name) = Count(C1.PF_RESULT_SEQ) Then CONCAT(C1.Result_Value,'(C/P)')
    When count(FCurrent.Field_Name) > 0 and count(FPast.Field_Name) =0 and count(Fcurrent.Field_Name)+ count(FPast.Field_Name) = Count(C1.PF_RESULT_SEQ) Then CONCAT (C1.Result_Value,'(C)')
    When count(FCurrent.Field_Name) = 0 and count(FPast.Field_Name) >0 and count(Fcurrent.Field_Name)+ count(FPast.Field_Name) = Count(C1.PF_RESULT_SEQ) Then CONCAT(C1.Result_Value,'(P)')
    End Result
    From
    [AnalyticsDW].[dbo].[rr_stag_PF_Results] A1
    join [AnalyticsDW].[dbo].[rr_stag_PF_Results] C1 on A1.PF_Result_Seq = C1.PF_Result_Seq
    join [AnalyticsDW].[dbo].[rr_PF_Fields_Dept] FCurrent on A1.PF_Result_Seq = FCurrent.RES_SEQ
    AND FCurrent.Field_Name = 'Current'
    AND A1.Label_Seq in('187582', '187576','187612','187600','187618','187612')
    left join [AnalyticsDW].[dbo].rr_PF_Fields_Dept FPast on A1.PF_Result_Seq = FPast.Res_Seq
    AND FPast.Field_Name = 'Past'
    AND A1.Label_Seq in('187583', '187577','187613','187601','187619','187613')
    WHERE
    A1.Result_Value ='Yes'
    AND (C1.Result_Value in ('Dyspnea', 'Confusion','Pressure Ulcer', 'Stasis Ulcer','Depression','Anxiety'))
    GROUP BY
    C1.CPI_Seq,
    C1.Result_Value
    ) L1
    FOR XML PATH('')),1,2,'')) RESULTS

    ;With CTE
    AS
    SELECT
    C1.CPI_Seq AS CPI_SEQ,
    C1.Result_Value AS RESULT_VALUE
    From
    [AnalyticsDW].[dbo].[rr_stag_PF_Results] A1
    join [AnalyticsDW].[dbo].[rr_stag_PF_Results] C1 on A1.PF_Result_Seq = C1.PF_Result_Seq
    join [AnalyticsDW].[dbo].[rr_PF_Fields_Dept] FCurrent on A1.PF_Result_Seq = FCurrent.RES_SEQ
    AND FCurrent.Field_Name = 'Current'
    AND A1.Label_Seq in('187582', '187576','187612','187600','187618','187612')
    left join [AnalyticsDW].[dbo].rr_PF_Fields_Dept FPast on A1.PF_Result_Seq = FPast.Res_Seq
    AND FPast.Field_Name = 'Past'
    AND A1.Label_Seq in('187583', '187577','187613','187601','187619','187613')
    WHERE
    A1.Result_Value ='Yes'
    AND (C1.Result_Value in ('Dyspnea', 'Confusion','Pressure Ulcer', 'Stasis Ulcer','Depression','Anxiety'))
    GROUP BY
    C1.CPI_Seq,
    C1.Result_Value
    SELECT CPI_Seq,
    STUFF((SELECT ',' + Result_Value
    FROM CTE
    WHERE CPI_Seq = c.CPI_Seq
    FOR XML PATH(''),TYPE).value('.','varchar(max)'),1,1,'') AS Results
    FROM (SELECT DISTINCT CPI_Seq FROM CTE)c
    Please Mark This As Answer if it helps to solve the issue Visakh ---------------------------- http://visakhm.blogspot.com/ https://www.facebook.com/VmBlogs

  • Alternative function to WM_CONCAT

    Hi,
    I am using eBusiness Suite 11g containing an Oracle financials 10 database. The schema WMSYS is missing and I am unable to use WM_CONCAT function. Are there any other alternative functions or SQL that can help with cross-tabbing comma seperated values to avoid queries returning multiple lines.
    For example:
    JE_HEADER_ID SOURCE INVOICE_NUM DESC PO_NO AMOUNT
    14055 Payables 38761 Paperchase 10145 461.55
    14055 Payables 38761 Paperchase 10148 461.55
    I would like the PO_NO to be concatenated on one line so that the query returns only one line as below:
    JE_HEADER_ID SOURCE INVOICE_NUM DESC PO_NO AMOUNT
    14055 Payables 38761 Paperchase 10145, 10148 461.55
    Your feedback will be appreciated.
    Thanks

    Hi,
    Thanks for your help, rtrim(xmlagg(xmlelement(e,ph.segment1,',').extract('//text()')),',') segment1 seems to work best in eBusiness suite with database version 10. The function LISTAGG works from 11g onwards and STRAGG requires a functions to be created and called within a SQL query.
    All of the above were useful to know.
    Thanks again

  • How we will get source of wm_concat

    Hai Friends,
    How we will get source code for wm_concat function. My user is not getting access of the function

    In any case - following seems to work (but not in 9i):
    code copied from a 10g instance so no warranty:
    SQL>  CREATE OR REPLACE
    type       WM_CONCAT_IMPL wrapped
    a000000
    1
    abcd
    abcd
    abcd
    abcd
    abcd
    abcd
    abcd
    abcd
    abcd
    abcd
    abcd
    abcd
    abcd
    abcd
    abcd
    d
    270 160
    bg9hz+fBwa888VEZGViHFs/oOP0wg433f64df3QCWE7VehmhTFcUe3y+JrsniV3cSuvmnE3g
    Y93dtR+cCsU1N+UQDGbtzhCf2HIdr8lPzfgF2bmCTvmGlHQbTAjTftNrDq3p093ncwb32OyX
    3ZFDTeH2jpjm3uWYyT8kZBfJIYxRwgLfRApoW32cpy0eRnvDBt2XfTAMXKCSNnqSoTiGA83W
    6deKW+rWyBu9L/EPyFkmQZeBncNsiNDF8fa1Sm6vdQiEanlCQnaPJ11a0na8hK6psDSaey+x
    fdMupCwSvg6gMrSV4QCguhOCqW2AmxRVMqpXJootPpTBxBFZc7hORGbriUI=
    Type created.
    SQL>  CREATE OR REPLACE function wm_concat wrapped
    a000000
    1
    abcd
    abcd
    abcd
    abcd
    abcd
    abcd
    abcd
    abcd
    abcd
    abcd
    abcd
    abcd
    abcd
    abcd
    abcd
    8
    58 96
    +CuW1MAfZPVR6NOnXKVmXY2o9pswg8eZgcfLCNL+XhZy8K7/cgzcVrPnfMPnx3TAM7h0ZSXD
    j57Asr2ym9ZtFldFmFu+RdpAU8VGORKSvtVG+DmAOR4C+NTa+Pit2kDbEpI5zhZUgqameSkE
    DQ==
    Function created.
    SQL>  select wm_concat(object_id) from sys.user_objects
    WM_CONCAT(OBJECT_ID)                                                           
    108674,108672,53144,53147,53150,53151,53162                                    
    1 row selected.

  • Order of values passed to ODCIAggregateIterate

    I have implemented my own aggregate function that concatenates varchar2 values together. It works perfectly, however, the order of the aggregated data is inconsistent and does not match the order that it occurs in the table the aggregation is over ( I have sorted the data). As an example:
    original data:
    column_a     column_b
    a                1-abc
    a                2-abc
    a                3-abc
    b                1-abc
    b                2-abc
    b                3-abcafter aggregation query
    column_a         column_b_concat
    a                    1-abc,3-abc,2-abc
    b                    1-abc,2-abc,3-abcMost of the concatenated data is correct (2nd row) but some of it is not (1st row). My question is....Is there a way to force the order of the aggregated rows to be maintained? I understand for aggregations such as count, sum or avg order is unimportant and so the db optimizes it to run as fast as possible. I can do this using PL/SQL but the execution time is much longer and would rather avoid it if possible.
    Thanks.
    Edited by: user8092994 on Feb 23, 2009 5:11 PM

    Hi,
    Let's phrase the question in terms of the scott.emp table and the wm_concat function, which a lot of people using Oracle 10 (and up) have available.
    Right now you're doing something like:
    SELECT    deptno
    ,       WM_CONCAT (ename)     AS ename_concat
    FROM       scott.emp
    GROUP BY  deptno;and getting results like
    .   DEPTNO ENAME_CONCAT
            10 CLARK,KING,MILLER
            20 SMITH,FORD,ADAMS,SCOTT,JONES
            30 ALLEN,BLAKE,MARTIN,TURNER,JAMES,WARDexcept that the names aren't in order (which is exactly the problem: you need to be sure they are in order, as shown above).
    I can think of three ways to do that:
    (1) modify the function (as you have already considered)
    (2) use CONNECT_BY_PATH instead of the function
    (3) use the analytic form of the function
    My guess is that the options above are listed in order of execution speed ((1) is fastest), but that's just my hunch.
    Option (2) works like this:
    WITH       got_r_num   AS
         SELECT     deptno
         ,     ename
         ,     ROW_NUMBER () OVER
                      (     PARTITION BY     deptno
                           ORDER BY       ename
                      ) AS r_num
         FROM     scott.emp
    SELECT     deptno
    ,     SUBSTR ( SYS_CONNECT_BY_PATH (ename, ',')
                , 2
                )     AS ename_concat
    FROM     got_r_num
    WHERE     CONNECT_BY_ISLEAF     = 1
    START WITH     r_num     = 1
    CONNECT BY     r_num     = PRIOR r_num + 1
         AND     deptno     = PRIOR deptno;Option (3) works like this:
    WITH  got_concat     AS
         SELECT     deptno
         ,     WM_CONCAT (ename) OVER
                     (       PARTITION BY     deptno
                            ORDER BY       ename
                     ) AS e_concat
         FROM     scott.emp
    SELECT       deptno
    ,       MAX (e_concat)     AS ename_concat
    FROM       got_concat
    GROUP BY  deptno;Any user-defined aggregate function can also serve as an analytic function: just add "OVER (...)" when you run it.
    Within each partition, the various values of e_concat will all be longer versions of one another, all starting the same way.
    For example, in deoptno = 10, the various values are
    CLARK
    CLARK,KING
    CLARK,KING,MILLERThe one you want to display is the longest one, which, since they all start the same way, will also be the MAX.

  • How to get rows values in a column only ?

    How to get all returned values in rows in a column.
    e.g., a query gives output as :
    123
    234
    233
    12121
    all in different rows. But i want the result like this:
    123,234,233,12121.All in a single row and a single column .
    How is this possible ?

    prakash wrote:
    hi ,
    Use the following example
    CREATE or  replace  FUNCTION fn_return_row
    RETURN VARCHAR2
    IS
    v_row   VARCHAR2 (32767);
    BEGIN
    FOR curr_row IN (SELECT ename
    FROM emp11)
    LOOP
    v_row := v_row ||','|| curr_row.ename;
    END LOOP;
    RETURN v_row;
    EXCEPTION
    WHEN OTHERS
    THEN
    RETURN NULL;
    END fn_return_row;
    select fn_return_row from dual ;Thanks,
    P PrakashThere's no need to use PL/SQL when SQL provides adequate functionality to do it.
    The title of the thread is misleading as turning rows into columns is called pivoting, but the description of the issue wanting to join all the rows together into a single column, is actually called string aggregation.
    As already demonstrated it can be done several ways.
    1. with XML functionality
    2. using the SYS_CONNECT_BY_PATH method
    and if you have 11gR2, there's...
    3. the new LISTAGG analytical function.
    There is also an undocumented WMSYS.WM_CONCAT function, though this isn't as flexible as other methods in that you can't control the order of the aggregated data so easily, and using such undocumented functions in production code is dangerous, as the functionality could change in future versions of Oracle, as well as it's use making your code such that Oracle will not provide support if the code with issue is using it.

  • Displaying results with comma

    Hi i have two tables that have a one-to-many relationship and i want to display the output as comma delimitters. The two tables are
    TABLE TABLE1
    OVERSION_ID NUMBER NOT NULL,
    PREVIOUS_V_ID NUMBER NOT NULL
    TABLE TABLE2
    OVERSION_ID NUMBER NOT NULL,
    so for example if i run the query
    select * from table1
    the result is
    OVERSION_ID PREVIOUS_V_ID
    12456 25677
    12456 25702
    12456 27897
    how can i write an sql query that will display all previous_v_id seperated by a comma like below
    25677, 25702, 27897
    Thank you very much.

    i have used the wm_concat function and it worked
    select oversion_id, wm_concat(previous_v_id) from table1 group by oaversion_id;
    however i have 2 other tables
    TABLE TABLE3
    OVERSION_ID NUMBER NOT NULL,
    OID NUMBER NOT NULL
    TABLE TABLE4
    OID NUMBER NOT NULL
    ONUMBER VARCHAR2 NOT NULL,
    You can see the relation between table 3 and table 4
    how can I change the query
    "select oversion_id, wm_concat(previous_v_id) from table1 group by oaversion_id;"
    so that i get the output as onumber and not the previous_v_id
    in other words how can I join these tables so the output is not the numbers (previous_v-id) , but the varchar2 (onumber) from table4

  • Who can help me with this query???

    I have a table looks like:
    Group_id, Individual_id, field1, field2, field3...
    For individuals in this table who shares the same group id, they have exact same, filed1, 2, 3, 4 but different individual_id.
    How can I comebine them so I can creat a table that looks like:
    group_id, (Individual_id1, individual_id2, 3...), field1, field2, field3....
    Please Help!

    Use the WM_CONCAT function.
    http://www.psoug.org/reference/undocumented.html#uwmc

  • Multiple rows into single pipe delimited row ........

    Hi All
    I have the following data in multiple columns which needs to be converted into single pipedelimited row.
    Followinf is the example:
    DEPTNO ENAME
    ===== =====
    10 A
    10 B
    10 C
    Now my requirement is in output i should be able to display A|B|C|.........
    Note : The number of rows for any DEPTNO are not constant.
    Thanks,
    kalyan Kumar P

    Hi,
    I tried but it is not throwing error that "Invalid Identifier" and moreover you told it is undocumentes
    please tell me what i need to do to to make "wm_concat" work.If there is any alternate also please let me know.In your database WMSYS user is not created that is why you are not getting 'wm_concat' function.
    Create WM_CONCAT function with this
    CREATE OR REPLACE TYPE BODY wm_concat
    IS
       STATIC FUNCTION odciaggregateinitialize (sctx IN OUT wm_concat)
          RETURN number
       IS
       BEGIN
          sctx :=   wm_concat (NULL);
          RETURN odciconst.success;
       END;
       MEMBER FUNCTION odciaggregateiterate (self IN OUT wm_concat, p1 IN varchar2)
          RETURN number
       IS
       BEGIN
          IF (curr_str IS NOT NULL)
          THEN
             curr_str :=   curr_str || ' , ' || p1;
          ELSE
             curr_str :=   p1;
          END IF;
          RETURN odciconst.success;
       END;
       MEMBER FUNCTION odciaggregateterminate (self IN wm_concat, returnvalue OUT varchar2, flags IN number)
          RETURN number
       IS
       BEGIN
          returnvalue :=   curr_str;
          RETURN odciconst.success;
       END;
       MEMBER FUNCTION odciaggregatemerge (self IN OUT wm_concat, sctx2 IN wm_concat)
          RETURN number
       IS
       BEGIN
          IF (sctx2.curr_str IS NOT NULL)
          THEN
             self.curr_str :=   self.curr_str || ' , ' || sctx2.curr_str;
          END IF;
          RETURN odciconst.success;
       END;
    END;
    CREATE OR REPLACE FUNCTION wm_concat (p1 varchar2)
       RETURN varchar2
       AGGREGATE USING wm_concat;
       After creating this function try this query
    SELECT REPLACE (wm_concat (ename), ',', '|') ename FROM emp;Let me know if problem persist.
    Regards,
    Mahesh Kaila

  • Printing data in horizontal

    Hi,
    i have the numbers i table.the table is having only one field and i want to get the output to be displayed in horizontal way..how can i get it.
    1,2,3,4,5,6,7,8,10
    the data should be displayed in this manner through query..

    hi
    just simple use wmsys.wm_concat function with column name as parameter like this :
    select wmsys.wm_concat(c5) from  a2

  • Any function like WM_CONCATE  in webi 4.0?

    Hi ,
    I am trying to have different values coming from the same column in DB , to accumulate in one cell and also wanna concatenate it
    For Example ,
    Country
    Projects
    USA
    111
    USA
    1222
    USA
    3333
    want to show the above as in one cell
    USA          111,1222,3333
    I know it can be done at DB level by WM_CONCATE but how to do it in Webi 4.0?

    Hello Usman,
    PFB a useful link where a similar requirement has been explained well.
    http://bi.srivatsakr.com/2011/08/converting-rows-into-single-cell-comma.html
    Hope it helps
    Regards,
    Nikhil Joy

  • Select Into statement in db function - query from granted schema table

    problem with "select into" in db function in 10.2
    There are two schemas. 'mdbdev' is the master database and 'devusr' is granted SELECT table access to execute queries in mdbdev schema.
    with devusr, in SQL, I'm able to execute the following query
    select wm_concat(strConcatedCountryList)
    from (select country_name as strConcatedCountryList from mdbdev.country_master mdbcm
    where mdbcm.country_ship_status = <param?>
    order by country_name)
    but when I use the same query in function/procedure with "select into", the compilation failed with error *"table or view does not exist"*
    FUNCTION GETCOUNTRYLISTTOSHIP (SHIP_STATUS IN NUMBER)
    RETURN VARCHAR2
    IS
    var2CountryList VARCHAR2(1000);
    BEGIN
    select wm_concat(strConcatedCountryList) INTO var2CountryList
    from (select country_name as strConcatedCountryList from mdbdev.country_master mdbcm
    where mdbcm.country_ship_status = <value of SHIP_STATUS>
    order by country_name);
    return var2CountryList;
    END;
    Please advise/help/hint :)

    David, Justine, Thank you. The facts from this forum post helped a lot to get the solution.
    The query helped a lot (select * from all_tab_privs_recd where owner = 'MDBDEV' and table_name = 'COUNTRY_MASTER").
    there was a grant using ???(donno wht DBA said) and no direct SELECT grant on that country_master to "devusr". grant command executed. Now, it works :)

  • Wm_concat problem in different version

    Hi,
    I am getting some problem with WM_CONCAT it is working in 10.2.0.1 but in 10.2.0.5 it is throwing error like this
    ORA-00932: inconsistent datatypes: expected - got CLOBHow to solve this.
    Thanks & Regards,
    Poorna Prasad.S

    This is a great example of why you shouldn't use undocumented functions. As we always say, Oracle can choose to change it's functionality and there's nothing you can do about it. It's not a bug, it's just what Oracle have chosen to do. If it was a documented function and the functionality had changed such that documented functionality of it was no longer working, then you'd have a right to complain and raise a bug issue with Oracle. You'll just have to rewrite your code to use a proper way of aggregating your data, such as a user defined aggregate function e.g.
    create or replace
      type clobagg_type as object(
                                  text clob,
                                  static function ODCIAggregateInitialize(
                                                                          sctx in out clobagg_type
                                    return number,
                                  member function ODCIAggregateIterate(
                                                                       self  in out clobagg_type,
                                                                       value in     clob
                                    return number,
                                  member function ODCIAggregateTerminate(
                                                                         self        in     clobagg_type,
                                                                         returnvalue    out clob,
                                                                         flags       in     number
                                    return number,
                                  member function ODCIAggregateMerge(
                                                                     self in out clobagg_type,
                                                                     ctx2 in     clobagg_type
                                    return number
    create or replace
      type body clobagg_type
        is
          static function ODCIAggregateInitialize(
                                                  sctx in out clobagg_type
            return number
            is
            begin
                sctx := clobagg_type(null) ;
                return ODCIConst.Success ;
          end;
          member function ODCIAggregateIterate(
                                               self  in out clobagg_type,
                                               value in     clob
            return number
            is
            begin
                self.text := self.text || value ;
                return ODCIConst.Success;
          end;
          member function ODCIAggregateTerminate(
                                                 self        in     clobagg_type,
                                                 returnvalue    out clob,
                                                 flags       in     number
            return number
            is
            begin
                returnValue := self.text;
                return ODCIConst.Success;
            end;
          member function ODCIAggregateMerge(
                                             self in out clobagg_type ,
                                             ctx2 in     clobagg_type
            return number
            is
            begin
                self.text := self.text || ctx2.text;
                return ODCIConst.Success;
            end;
    end;
    create or replace
      function clobagg(
                       input clob
        return clob
        deterministic
        parallel_enable
        aggregate using clobagg_type;
    SQL> select trim(',' from clobagg(ename||',')) as enames from emp;
    ENAMES
    SMITH,ALLEN,WARD,JONES,MARTIN,BLAKE,CLARK,SCOTT,KING,TURNER,ADAMS,JAMES,FORD,MILLER
    SQL>

Maybe you are looking for

  • Order Canceled: unable to verify information

    Placed a $30 order last week.  Cancelled immediately "unable to verify information" after getting the order confirmation.  Spent 45 minutes on the phone to be told, "I don't know."  Shipping and Billing info are correct.  The same credit card seems t

  • Java.lang.NoClassDefFoundError when compile class in Weblogic Linux Env.

    Hi, I'm trying jay article ( http://jaysensharma.wordpress.com/2009/08/17/mdb3-0-sample-for-weblogic-application-server/ ) for send message to JMS, it works great in windows but in Linux is failed. I'm facing the issue when compile QueueSend class li

  • JAXB marshaling and unmarshaling

    I used JAXB to generate nine classes (one is simply a type-safe enum) to correspond to my XML DTD. I then wrote the code to instantiate the root and some child elements which are all added to the root content. Then I am able to call validate() and ma

  • Ask a question about SIO

    I want to realize the function that client applet can invoke the method of Server applet through SIO First, I define and implant a shareable interface on the Server applet and that have passed the compiling. Code: (server applet) package temp1; Publi

  • Trouble closing a window

    Hello, I'm using Robohelp 6. I just copied a snippet of html from an older help file that closes the help window. I pasted it into a new help file, but it does not work. When you click the End button, it appears to just hang, doing absolutely nothing