NumberFormat Parse gives incorrect result for comma separator

I have a string 1,5 and i am creating NumberFormat with US locale. I expect NumberFormat.parse method to give me exception for string 1,5 string. But it doesn't. The result is 15 for 1,5 string. Please help.
I have a class where i did test. I have tried 3 cases. All 3 cases didn't work. Any idea how to solve it?
import java.util.*;
import java.text.*;
public class testv
     public static void main(String[] args)
          DecimalFormatSymbols symbols = new DecimalFormatSymbols(Locale.US);
          System.out.println("Decimal separator: "+symbols.getDecimalSeparator());
          System.out.println("Group separator: "+symbols.getGroupingSeparator());
          String s = "1,5";
          NumberFormat fmt = NumberFormat.getInstance(Locale.getDefault());
          Number num = null;
          try
               //start of case 1*********
               num = fmt.parse(s);
               //end of case 1************ desn't work
               //start of case 2*********
               /*ParsePosition parsePosition = new ParsePosition(0);
               num = fmt.parse( s, parsePosition);
               if (! ((parsePosition.getIndex()) == ( s.length() )) )
                    throw new ParseException("parseerror",0);
               //end of case 2*********          desn't work     
               //start of case 3*********
               /*if (fmt instanceof DecimalFormat)
                    ParsePosition parsePosition = new ParsePosition(0);
                    num = fmt.parse( s, parsePosition);
                    if (! ((parsePosition.getIndex()) == ( s.length() )) )
                         throw new ParseException("parseerror",0);
               //end of case 3************ desn't work
          catch (Exception e)
               e.printStackTrace();
          System.out.println("Parse string: "+s+" result: " + num.toString()+" result in double: "+num.doubleValue()+" locale: "+Locale.getDefault());
     }

Hi,
According to your description, I am afraid your problem is out of support in C# forum. For ASP.NET question, please go to
ASP.NET Forum to post your thread.
Best Wishes!
We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
Click
HERE to participate the survey. Thanks<br/> MSDN Community Support<br/> <br/> Please remember to &quot;Mark as Answer&quot; the responses that resolved your issue. It is a common way to recognize those who have helped you, and
makes it easier for other visitors to find the resolution later.

Similar Messages

  • Custom Document for Comma Separated Values in a JTextField

    Hi,
    I tried to create a custom structured Document implementation for comma separated values (on one line) in a JTextField:
    I want to have one LeafElement for each value (to store as an attribute the Object associated with this value). So, if I plug a DocumentListener to the JTextField, I can easily see which value(s) have been added/removed (see ElementChange).
    I used the PlainDocument implementation as a starting point and replaced the logic related to the '\n' character by the ',' (see #insertUpdate).
    Then I realized that the View must be customized too. So I created a View with a custom #paint method to draw each LeafElement on the same line.
    But, now, I try to fix the ElementChange returned by the #insertUpdate and #removeUpdate methods.
    Indeed, I played with a JTextArea with two lines "Bart\nisa" and plugged a debugging DocumentListener.
    And the event I get when I type 'L' before "isa" is really strange:
    - Two elements removed,
    - Two elements added.
    In the PlainDocument#insertUpdate, the code updates the 'offset' but I don't understand the logic behind.
    Could you explain me why I got this result?
    Could you give me an hint?
    Best Regards,
    El Barto.

    When you say the offset gets updated, I assume you're talking about this bit:
         int offset = chng.getOffset();
         int length = chng.getLength();
         if (offset > 0) {
           offset -= 1;
           length += 1;
         } The result is that, if a character is added at the very beginning or end of a line, the edit gets treated as a multi-line edit, which means the LeafElements on either side of the edit get removed and reconstructed. I discovered this behavior a few years ago, and I never have figured out what purpose it serves. I think you'll just have to try overriding the method to eliminate that behavior, and see what happens.

  • Incorrect results for calculation based on diff dimensions - 11.1.1.5

    Hello All,
    OBIEE gives incorrect results when i try to perform a calculation (for eg: addition) based on 2 measures. For eg:
    (Note: "->" signifies 1:M)
    Rpd (Physical model & BMM): dim_fe -> dim_gl-> Fact_Legder <- Dim_param
    Fact_Ledger (agg measures) -> YTD_01, YTD_02...... YTD_12 ( here 01,02...12 represent month i.e. if "Feb" selected in prompt then we need to use YTD_02 and so on for other months)
    Answers: Created a report with following columns
    Column Name : Formula
    =================
    Line Item : 'Net Profit'
    Prev Yr Act: (filter("Fact Ledger"."YTD_12" using "Fact_Ledger"."YEAR"=@{pYear}{2013}-1 and "Dim_Param"."PL_Line" in ( 'Item 1','Item 2','Item 3') and "Fact_Ledger"."Code"=100)/1000) /
    (filter("Fact Ledger"."YTD_12" using "Fact_Ledger"."YEAR"=@{pYear}{2013}-1 and "Dim_FE"."Item" in ( 'L1','L2','L3') and "Fact_Ledger"."Code"=100)/1000)
    Curr Yr Act: (filter("Fact Ledger"."YTD_12" using "Fact_Ledger"."YEAR"=@{pYear}{2013} and "Dim_Param"."PL_Line" in ( 'Item 1','Item 2','Item 3') and "Fact_Ledger"."Code"=100)/1000) /
    (filter("Fact Ledger"."YTD_12" using "Fact_Ledger"."YEAR"=@{pYear}{2013} and "Dim_FE"."Item" in ( 'L1','L2','L3') and "Fact_Ledger"."Code"=100)/1000)
    Curr Yr Plan: case when '@{pmonth}{Jan}='Jan' then
    (filter("Fact Ledger"."YTD_01" using "Fact_Ledger"."YEAR"=@{pYear}{2013} and "Dim_Param"."PL_Line" in ( 'Item 1','Item 2','Item 3') and "Fact_Ledger"."Code"=200)/1000)/
    (filter("Fact Ledger"."YTD_01" using "Fact_Ledger"."YEAR"=@{pYear}{2013} and "Dim_FE"."Item" in ( 'L1','L2','L3') and "Fact_Ledger"."Code"=200)/1000)
    when '@{pmonth}{Jan}='Feb' then
    (filter("Fact Ledger"."YTD_02" using "Fact_Ledger"."YEAR"=@{pYear}{2013} and "Dim_Param"."PL_Line" in ( 'Item 1','Item 2','Item 3') and "Fact_Ledger"."Code"=200)/1000)/
    (filter("Fact Ledger"."YTD_02" using "Fact_Ledger"."YEAR"=@{pYear}{2013} and "Dim_FE"."Item" in ( 'L1','L2','L3') and "Fact_Ledger"."Code"=200)/1000)
    when '@{pmonth}{Jan}='Dec' then
    (filter("Fact Ledger"."YTD_12" using "Fact_Ledger"."YEAR"=@{pYear}{2013} and "Dim_Param"."PL_Line" in ( 'Item 1','Item 2','Item 3') and "Fact_Ledger"."Code"=200)/1000)/
    (filter("Fact Ledger"."YTD_12" using "Fact_Ledger"."YEAR"=@{pYear}{2013} and "Dim_FE"."Item" in ( 'L1','L2','L3') and "Fact_Ledger"."Code"=200)/1000)
    endthe results are incorrect. Any help appreciated.
    Qry generated is like
    (select...
    case when year=.. and pl_lin=... and code=100 then ytd_01,
    case when year=.. and pl_lin=... and code=100 then ytd_03,
    case when year=.. and pl_lin=... and code=100 then ytd_04,....,
    case when year=.. and pl_lin=... and code=200 then ytd_01,
    case when year=.. and pl_lin=... and code=200 then ytd_03,
    case when year=.. and pl_lin=... and code=200 then ytd_04,....,
    from...
    where ... year in (2013-1,2013) and pl_line('Item1,'Item2','Item3') or fe.item('l1','l2','l3') and code in (100,200)... ) D1
    (select
    case when 'Apr'='Jan' thne d1.c1 when 'Apr'='Feb' then d1.c2......
    from D1
    Regards..
    Shruti

    See if this explains it better for my crosstab with page items of Vendor Number 1234.
    Vendor 1234
    Dc Nbr 1 2 4 AAAA
    Sum Invoice Amt 1387.04 300.82 327.29 2015.15
    Sum Cost 44.86 57.43 25.54 127.83
    Sum Advanced Cost 102.44 0 0 102.44
    Sum Consolidation Cost 30.37 0 0 30.37
    Sum Allowance Amt 27.74 6.02 6.54 40.30
    Net Freight Cost 149.93 51.41 19 220.34
    Freight Percent 10.81 17.09 5.81 ****
    As stated before, Frieght Percent is a calculation I created in Discoverer that looks like this :
    ( NVL(Sum Cost,0)+NVL(Sum Advanced Cost,0)+NVL(Sum Consolidation Cost,0)-NVL(Sum Allowance Amt,0) )/NVL(Sum Invoice Amt,0)*100
    Column AAAA was created in Discoverer using Sum of field and show to the right.
    What I need is for the **** to be the correct calculation for the totals in column AAAA. If I use do a total for Freight Percent using the Cell Sum I get 33.70., what I want is it to be 10.93, which is (127.83 + 102.44 + 30.37 - 40.30)/2015.15*100.
    If I use an Average Total row for Freight Percent, I get 11.24 which is 33.70 / 3 (the 3 would be the # of dc nbr's)
    I did start with using the detail level data to create this crosstab. Then I made a new version and used the SUM data. I seem to get the same results but am still having issues with the one **** value.
    Hopefully this explains it better.
    Thanks for the ideas so far.

  • Maps can not find my location, or gives incorrect results

    when I tap the "locator" icon at the bottom right of Maps, it can't find my location, or gives incorrect results such as San Francisco, or somewhere south of Detroit, MI

    This is what I did, and it worked for me. My location was coming up in the correct city, Philadelphia, but at the wrong neighborhood, a couple of miles away. I turned off the wifi, and made the locator find me by Edge only. Then I turned the Wifi back on and had the locator find me again, and it went back to the wrong location, but 2 seconds later found the correct address within a few blocks. I have the Original iPhone BTW.

  • Look Up For Comma Separated Strings

    Hi,
    How to look up for comma separated string from livecycle forms manager ??
    Plz gimme an idea on this.
    Raghava Kumar V.S.S.

    Hi
    My point is that the more detailed you ask your question, the more likely you are to get an answer.
    Those of us who monitor these newsgroups also appreciate you doing as much of your own research as possible, before asking us for help - we're more likely to spend our own (personal and valuable) time helping you, if we know that you've spent your own time doing research, and you've still not been able to solve the problem.
    I look forward to your next question :-)
    Howard

  • P/L A/c for a single day gives different results for different users

    Hi!
         We have SAP B1 8.81 (PL 09) in our office. P/L Account for a particular date gives different value for a single account (Other Income Account) for one user and a consistent value for all other users. The user in question is a super user and does not seem to pick a specific entry posted in the Other Income Account for that day thus giving erroneous result. I have checked the Trial Balance for that day and it gives proper result. Only the P/L account gives erroneous data. Could anyone help with the reason for this.
    Thanks
    Sreekumar

    Hi Jitin,
              Thanks for your reply.
              I tried the way you mentioned. However, the result is the same.
              The entry that I'm talking about is an automatic journal entry posted through the Outgoing Payment option.
              To make it more clear, an outgoing payment to a vendor was posted on 05/19/11 for 1,42,178.32. The check was drawn only for 71,089.16 which was the correct amount and the remaining amount (71,089.16) got posted in the Other Income account. The P/L account for this date is not picking the amount of 71,089.16 in the Other Income Account.
    Thanks & Regards
    Sreekumar
    Edited by: Sreekumar on Jan 31, 2012 5:58 PM

  • NonLinearFitWithMaxIters does not give correct results for phase

    Dear all,
    I am trying to fit a sin cuve with NonLinearFitWithMaxIters function of labwindows, but the results given by this function are dispersed a lot (the function does not give same results).
    In fact, I have two waveforms signals v and i (of 104 points), and I  find the phase between the two signals with NonLinearFitWithMaxIters.
    The two singals v and i are  measured with an osciloscope.
    I use the following fit functions :
    v=p1*sin(wt+p2) ;
    i=p3*sin(wt+p4) ;
    I use the NonLinearFitWithMaxIters function to fit the data and to have the parameters  p1, p2, p3, p4. Then, the phase is claculated as follow phase=p4-p3.
    The problem is that the phase calculted between the two signals (v and i) is different for each run for the same conditions.
    In fact, for a same condition, I measure different times the signals v and i, and I calculate the phase p4-p3, using NonLinearFitWithMaxIters. The goal is to calculate a mean of phases for the same condition. For example, there are cases where the phase=-5 degree, and other cases when phase=12 degree.
    For ten measures of v and i, the phase calculated is different. I get a big dispersion between the phases.
    I would like to know please why I have a big difference in phases calculated with the same condition?whern using NonLinearFitWithMaxIters.
    I read that this function does not give all time the correct results, is there a way to know when the results are not corrects and when they are correct ?
    And is there any solution to find accuratly the phase between the two waveforms.
    Thank you for your precious answer.

    The pseudocode which I am using is :
    v_err=NonLinearFitWithMaxIters(array_x,array_v,v_y_fit,1252,100,sinus,v_coef,2,&v_mean_squareError);
    The fit function is
    double sinus(double x, double a[],int noef){
        return (a[0]*sin((w*x)+a[1]));
     I use the same inital coeficient of v_coef for each run :     
    v_coef[0]=0.03;
    v_coef[1]=0.2;
    These coeficient are choosen arbitrary.
    In this case, the number of points of the data is 1252 (the data of array_v).
    The number of iterations is 100.
    For the array_x, the distance between adjacents values of the array is dt=0.4*1e-9(difference between array_x[i] anv array_x[i+1]=dt=0.4*1e-9 ).
    for (i=0;i<1252;i++){
    array_x[i]=i*(0.4*1e-9);
    The means square error returnned by the function when it is complished is  small, of the order of 0,001.
    I read the help
    « From the help:
    You must pass a pointer to the nonlinear function f(x,a) along with a set of initial guess coefficients a. NonLinearFitWithMaxIters does not always give the correct answer. The correct output sometimes depends on the initial choice of a. It is very important to verify the final result.
    That means that the function cannot be used, as it does not give correct results. How
    can we check if the results are good or not ? in my case.
    I think that in my case, the function does not give correct results, but how can I check if the results are good, or not ? The mean square error is small.

  • ITSM Search on status with "is not" gives incorrect results due to SLA statuses

    Hi,
    When executing a search on Solution Manager ITSM tickets, on the search criterion Status and with operator "is not", the result list does not give correct results.
    For example, an incident with status "Confirmed IRT Exceeded" does show up when searching with criterion "Status is not Confirmed".
    Is there any solution for this behaviour?
    Kind Regards,
    Joyca

    Hi Vivek,
    Thanks for the Knowledge Article.
    The content of the document would indeed help if we only wanted to find "not confirmed" tickets.
    However, the same thing is happening on other statuses. For example searching for "status is not proposed solution" is still not possible with the descriptions in the knowledge document, since the user status "proposed solution" is linked to system status "in process" (I1003), like all the other in-between user statuses such as "customer action" and "in process" etc.
    The only workaround that I see is to use only "is" as operator and never "is not". However, the underlying problem remains. I think it should be possible to use also "is not" without having issues due to those SLA statuses...
    Kr,
    Joyca

  • Subtracting two numbers in double format gives incorrect result

    Hello,
    I have a table with two fields in Number (Field Size: Double; Decimal Places: Auto).  When using a query i try to subtract one field from the other I get incorrect results:
    Field1
    Field2
    Result
    2.60299223923846
    2.60259423701324
    3.98002225218796E-04
    0.644498511499839
    0.645908903902985
    -1.41039240314556E-03
    1.51021791504783
    1.51372591514976
    -3.50800010193808E-03
    <tfoot></tfoot>
    When I paste the above into Excel, I get the correct results:
    Field1
    Field2
    Result
    2.60299223923846
    2.60259423701324
                         0.00039800222521880
    0.64449851149984
    0.64590890390299
                       (0.00141039240314556)
    1.51021791504783
    1.51372591514976
                       (0.00350800010193808)
    Would much appriciate any help in how to get the correct values in Access Query.
    Thank you

    Field1
    Field2
    Result
    2.60299223923846
    2.60259423701324
    3.98002225218796E-04
    0.644498511499839
    0.645908903902985
    -1.41039240314556E-03
    1.51021791504783
    1.51372591514976
    -3.50800010193808E-03
    Hi Vasilii,
    In my opinion the results are correct, only they are presented in scientific notation. You can do some formatting, to display the results the way you want.
    See the Help on the use of Format.
    Imb.

  • Quality check on Business Rules gives strang result for OMS-60005

    OMS-60005 Functions used to record business rules should be labeled as:
    BR_[entity short name]###([decomposition id])_[type abbreviation]
    BR_IDE024_CEW, BR_IDE029_CEV, BR_IDE030_CEW, BR_IPF004_CEW are violations but they are valid as far as I know.

    Yes my particular issue is not like yours. However, there have been many other laptop users experiencing similar problem to yours after 3.10 kernel. Mostly it seems to be bumblebee users that experience your problem with the blank screen. We do know that nvidia have yet to make their official drivers work with kernel 3.10 and up. The drivers in the Arch repository have been patched to work with 3.10. From what I have seen, this also only seem to be affecting laptops with newer nvidia gpu's. I fear there is not much to do with this problem until nvidia give official 3.10 kernel support.
    My suggestion would be to stick with 3.9.9 kernel and the drivers that work with it, and don't upgrade those packages until nvidia has addressed these issues. If you have a look at the nvidia forums you will see quite a number of topics mentioning black screen when starting x on 3.10 kernel, and also a thread for the system dying. Reading some of the threads there may help you keep up to date on whether or not the issue seem to be solved.
    https://devtalk.nvidia.com/default/board/98/

  • Why am I getting an incorrect result for my Pl/SQL procedure?

    Hello, I'm just trying to figure out % that limpCount makes up from playercount
    The result is always 100 even though limpcount and playercount are correct when printed out.
    CREATE OR REPLACE PROCEDURE workoutVPIPProc
    IS
    nrplayersV_PIP NUMBER(10);
    handCount NUMBER(10);
    playercount NUMBER(10);
    limpCount NUMBER (10);
    temp NUMBER (10);
    BEGIN
    SELECT count(nlhm_hands.NLHM_hand_number) INTO handCount FROM nlhm_hands;
    SELECT sum(nlhm_hands.NLHM_no_players_involved) INTO playercount FROM nlhm_hands;
    SELECT sum(nlhm_hands.NLHM_no_players_limp) INTO limpCount FROM nlhm_hands;
    temp := limpCount/playercount;
    nrplayersV_PIP := temp*100;
    DBMS_OUTPUT.PUT_LINE('The average VPIP for NLHM is: ' || nrplayersV_PIP||'% sum of players limped: '||limpCount||':'||playercount);
    END workoutVPIPProc;
    /

    A hint:
    SQL> select  cast(123/77 as number(10)) from dual;
    CAST(123/77ASNUMBER(10))
                           2
    SQL> select  cast(123/77 as number(10,5)) from dual;
    CAST(123/77ASNUMBER(10,5))
                        1.5974
    SQL> SY.

  • GetFloatProperty gives wrong result for values out of range

    Hi
    When the method setFloatProperty is called by setting the float values out of the range,then calling getFloatProperty does not give NumberFormatException.
    Float value set more the MAX_VALUE of float returns infinity when getFloatProperty is called.Similar problem occurs with setDoubleProperty.This behavior is confusing.can anyone help me out.
    Regards
    saroj13

    Throwing a NumberFormatException would never make sense in this situation. The exception indicates that you are trying to convert a String to a number, but the String does not contain a valid number. eg. "as3"; when a conversion was attemted would throw a NumberFormatException.
    Floats and Doubles in Java comply with the IEEE 754 standard which mandates the behaviour of the types.
    Could you explain why you find this confusing?
    Hope this helps.

  • Sqlloader:only 1st when clause works for comma separated data file

    LOAD DATA
    INFILE 'XXMI_SUPPLIER_DATA.dat'
    REPLACE
    INTO TABLE APPS.XXMI_AP_SUPPLIERS_STG
    when interface_record_type = '01'
    Fields terminated by "," Optionally enclosed by '"'
    TRAILING NULLCOLS
    and
    INTO TABLE APPS.XXMI_AP_SUPPLIER_SITES_STG
    when interface_record_type = '02'
    Fields terminated by "," Optionally enclosed by '"'
    TRAILING NULLCOLS
    always getting the error for second when clause:
    4 Rows not loaded because all WHEN clauses were failed.
    pls any one can throw some light on this?

    What's Oracle version.
    What's your datafile looks like. Post a few sample line here.
    when interface_record_type = '01'You didn't define interface_record_type in your when clause.
    Sample,
    INTO TABLE dept
       WHEN recid = 1
       (recid  FILLER INTEGER EXTERNAL TERMINATED BY WHITESPACE,
        deptno INTEGER EXTERNAL TERMINATED BY WHITESPACE,
        dname  CHAR TERMINATED BY WHITESPACE) check Oracle doc,
    http://download.oracle.com/docs/cd/B19306_01/server.102/b14215/ldr_control_file.htm#i1004788

  • Week function gives wrong result for last week in year

    Week(CreateDate(2011,12,25)) returns 51 - correct
    Week(CreateDate(2011,12,26)) returns 53 - wrong
    It looks like all last weeks of the year are 53 whereas the next year with 53 weeks should be 2015.
    See http://tuxgraphics.org/toolbox/calendar.html for example.
    I am running CF9 on Windows 7 with Java V6 update 29.
    This is causing me a problem. Any ideas for a workaround?
    Doug

    Here is my general solution for my cfc which seems to work for all dates up to 2100 at least.
    Hope it can help if you need a Week function to replace the CF one.
    <cffunction name="getISOWeekNum" access="public" returntype="Numeric" hint="Gets ISO week number in which date occurs.">
        <cfargument name="date" type="date" required="true" hint="Date for which you wish to know the week number">
        <cfset var weeknum = 0>
        <cfset var isLeap = isLeapYear(Year(date))>
        <cfset var dayInWeek = dayOfWeek(date)>
        <cfset var isoDayOfWeek = iIf(dayInWeek GT 1, dayInWeek - 1, 7)>
        <cfset var nearestThur = dateAdd("d", 4 - isoDayOfWeek, date)>
        <cfset var fourthDayOfYear = createDate(year(nearestThur), 1, 4)>
        <cfset var fourthDayInWeek = dayOfWeek(fourthDayOfYear)>
        <cfset var fourthIsoDayOfWeek = iif(fourthDayInWeek GT 1, fourthDayInWeek - 1, 7)>
        <cfset var firstThur = dateAdd("d", 4 - fourthIsoDayOfWeek, fourthDayOfYear)>
        <cfset var lastWeek = iIf(fourthDayInWeek EQ 8 OR (isLeap AND fourthDayInWeek EQ 7), 53, 52)>
        <cfset var firstIsoDayOfFirstWeek = dateAdd("d", -(fourthIsoDayOfWeek-1), fourthDayOfYear)>
        <cfset var firstIsoDayOfLastWeek = dateAdd("d", -7, firstIsoDayOfFirstWeek)>
        <cfset var lastIsoDayOfFirstWeek = dateAdd("d", 6, firstIsoDayOfFirstWeek)>
        <cfset var weekDiff = iIf(dateCompare(date, firstIsoDayOfFirstWeek, "d") EQ -1, 0, 1)>
        <cfif dateCompare(date, firstIsoDayOfFirstWeek, "d") EQ -1 AND dateCompare(date, firstIsoDayOfLastWeek, "d") NEQ -1>
            <cfset weeknum = lastWeek>
        <cfelseif dateCompare(date, lastIsoDayOfFirstWeek, "d") NEQ 1 AND dateCompare(date, firstIsoDayOfLastWeek, "d") NEQ -1>
            <cfset weeknum = 1>
        <cfelse>
            <cfset weeknum = weekDiff + (dateDiff("d", firstThur, nearestThur) / 7)>
        </cfif>
        <cfreturn weeknum>
    </cffunction>
    Doug

  • How to get result in comma separated

    I have the follwing query with simple join
    select c.f_category_id,c.f_category_name,sc.f_subcategory_id,sc.f_subcategory_name
    from mcp_adv_category c join mcp_adv_category_trans ct on c.F_CATEGORY_ID =ct.F_CATEGORY_ID join mcp_adv_subcategory sc
    on ct.F_SUBCATEGORY_ID =sc.f_subcategory_id
    CID      CNAME    SID      SNAME
    C152     M123456  SC107    FOOTER
    C152     M123456  SC108    TOP
    C152     M123456  SC111    LFT
    C152     M123456  SC100    right
    C153     AMA      SC108    TOP
    C153     AMA      SC107    FOOTER
    C155     RAMA     SC108    TOP
    C155     RAMA     SC100    right
    C155     RAMA     SC107    FOOTER
    9 rows selected.the required is
    CID      CNAME    SID                           SNAME
    C152     M123456  SC107,sc108,sc111,sc100    FOOTER,top,lft,right
    C153     AMA      SC108,sc107                 TOP,footer
    C155     RAMA     SC108 ,sc100,sc107          TOP,right,footerhow to do this?

    Example..
    SQL> ed
    Wrote file afiedt.buf
      1  select deptno, ltrim(sys_connect_by_path(ename,','),',') as enames
      2  from (
      3        select deptno, ename, row_number() over (partition by deptno order by ename) rn from emp
      4       )
      5  where connect_by_isleaf = 1
      6  connect by deptno = prior deptno
      7         and rn = prior rn + 1
      8  start with rn = 1
      9* order by deptno
    SQL> /
        DEPTNO ENAMES
            10 CLARK,KING,MILLER
            20 ADAMS,FORD,JONES,SCOTT,SMITH
            30 ALLEN,BLAKE,JAMES,MARTIN,TURNER,WARD
    Or to ensure names are distinct...
    SQL> ed
    Wrote file afiedt.buf
      1  select deptno, ltrim(sys_connect_by_path(ename,','),',') as enames
      2  from (
      3        select distinct deptno, ename, dense_rank() over (partition by deptno order by ename) rn
      4        from emp
      5       )
      6  where connect_by_isleaf = 1
      7  connect by deptno = prior deptno
      8         and rn = prior rn + 1
      9  start with rn = 1
    10* order by deptno
    SQL> /
        DEPTNO ENAMES
            10 CLARK,KING,MILLER
            20 ADAMS,FORD,JONES,SCOTT,SMITH
            30 ALLEN,BLAKE,JAMES,MARTIN,TURNER,WARD
    SQL>

Maybe you are looking for

  • Vid card works with adapter, not directly

    I have two monitors available: an old CRT that has VGA connector, and a new Dell E228WFP 22" LCD that has both VGA and DVI connector. My card is ATI Radeon 9000 Pro (DVI and ADC ports). The Dell has worked perfectly for almost a year. The problem beg

  • Text links in Dreamweaver CS3

    I have a grey line of text on a green background. When I add a link to the text, it shows up a purpleish blue in any web browser. I've checked Safari, Firefox, and Explorer. It changes the color once a link is added. I am fairly new to using Dreamwea

  • Why do i have to pay £25 to end my contract?

    Hiya I was wondering if anyone can tell me why i have to pay a £25 administration fee because my contract has come to an end and i dont want to continue it. Of course i am used to BTs hidden fees but i dont think this is fair as i cant see what i am

  • The music in my itunes library says it cant be found.

    The music in my itunes library says it cant be found and ive tried to sync my ipod touch (4g) with the library to transfer the purchases yet the music in my itunes library says  file can not be found" im trying to put music on my new ipod nano but on

  • Error 1310. Unable to update / repair / install

    For over a week, on start up of my computer Adobe Acrobat tries to do an update - and fails due to " error 1310. Error writing to file: C:\Program Files\Adobe\Acrobat 7.0\ActivX\AcroPDF.dll. Verify that you have access to that directory " But on canc