Rows to colon

Hey
Problem (rows to colon):
I have a table that looks like this:
Id value
1 10
1 20
1 20
2 70
2 40
2 50
And I want a table (result) that looks like this by a SQL statement
Id value value value
1 10 20 20
2 70 40 50
The numbers of value on each Id are fixed at runtime (query time) but not always the same (1-20 values).
How do I solve it? I it possible to solve like that?
/David Gustavsson
[email protected]
null

Here's one way:
SQL> create table test (col1 varchar2(20), col2 number);
Table created.
SQL> insert all
  2    into test values ('A:B:C', 1)
  3    into test values ('Dg:Ezs', 2)
  4  select * from dual;
2 rows created.
SQL> select
  2    t.col2,
  3    regexp_substr(t.col1, '\w+', 1, t2.column_value) c1
  4  from test t,
  5    table(cast(multiset(select level
  6                        from dual
  7                        connect by level <= length(t.col1) - length(replace(t.col1, ':', '')) + 1
  8                       ) as sys.odcinumberlist )) t2
  9  order by 2, 1;
      COL2 C1
         1 A
         1 B
         1 C
         2 Dg
         2 Ezs
SQL>Edited by: Littlefoot on Jan 31, 2012 10:13 AM

Similar Messages

  • Sorting with Number iwork 08

    Suppose the numbers 10,20,30 are in column B and in the rows 1,2,3.
    Supose the numbers 300,200,100 are in the column C and in the rows 1,2,3.
    Is it possible to sort the column C (in increasing order) without changing column B?
    Thank you.

    Are you saying that it's a poor design to assume that users are able to use a brain ?
    Here I uses plain Numbers with no extraneous feature.
    In "colonne 3" are stored the values which must appear in column 3 of Tableau 1
    In "colonne 4" are stored the values which must appear in column 4 of Tableau 1
    In column 3 of tableau 1 I use the very complex formula:
    =INDIRECT(ADDRESS(ROW(),2,,,"colonne 3"))
    In column 4 of tableau 1 I use the very complex formula:
    =INDIRECT(ADDRESS(ROW(),2,,,"colonne 4"))
    When I want to apply a sort on values of colum 3, I sort the table "colonne 3".
    When I want to apply a sort on values of colum 4, I sort the table "colonne 4".
    This is far from poor design. It's neat one !
    Yvan KOENIG (from FRANCE dimanche 29 mars 2009 16:14:13)

  • Non based forms PDF files

    Hi all,
    Anybody could help me in converting dinamic tables, textfields, etc from an IVIEW to a pdf document without using any forms...??
    thanks in advance

    Hi Ivan,
    I post you the code.
    METHOD
    toFoXML
    private String toFoXML() {
         StringBuffer x = new StringBuffer();
         String Text = new String("");
         int dimCol = 0;
         String ImgUrl = new String();
         x.append("<?xml version='1.0' encoding='utf-8'?>n");
         x.append("<root xmlns='http://www.w3.org/1999/XSL/Format' font-family='Times' font-size='20pt'>n");
         x.append("   <layout-master-set>n");
         x.append("      <simple-page-master master-name='frame' page-height='21cm' page-width='29.7cm' margin-top='3mm' margin-bottom='3mm' margin-left='3mm' margin-right='3mm'>n");
         x.append("         <region-body region-name='frame-body' margin-top='1mm' margin-bottom='1mm'></region-body>n");
         x.append("         <region-before region-name='frame-before' extent='1mm'></region-before>n");
         x.append("         <region-after region-name='frame-after' extent='1mm'></region-after>n");
         x.append("      </simple-page-master>n");
         x.append("   </layout-master-set>n");
         x.append("   <fo:page-sequence xmlns:fo='http://www.w3.org/1999/XSL/Format' master-reference='frame' >n");
         x.append("<fo:flow flow-name='frame-body'>n");
         x.append("<fo:block space-after.optimum='10pt' font-family='Helvetica' font-size='10pt'>n");
         try {
              WDDeployableObjectPart part = wdComponentAPI.getDeployableObjectPart();
              ImgUrl = WDURLGenerator.getAbsoluteWebResourceURL(part, "siemens.gif");
         } catch (WDURLException e1) {
              // TODO Auto-generated catch block
              e1.printStackTrace();
         x.append("<fo:external-graphic  width="63pt" height="10pt"  src="url('"+ImgUrl+"')"></fo:external-graphic>");
         x.append("<fo:table  border-top="solid black 1px" border-left="solid black 1px">n");
         //  COLONNA DEFAULT per EQUIPMENT
         dimCol = 10;
         dimCol = 11*dimCol;
         x.append("<fo:table-column column-width='");
         x.append(dimCol);
         x.append("pt'></fo:table-column>n");
         wdContext.nodeColumnSelezionati().moveFirst();
         do {
              Text = wdContext.currentColumnSelezionatiElement().getText();
              Text = Text.substring(Text.lastIndexOf("(")+1,Text.length()-1);
              dimCol = new Integer(Text).intValue();
              Text = wdContext.currentColumnSelezionatiElement().getText();
              Text = Text.substring(0, Text.lastIndexOf("("));
              if (dimCol < Text.length())
                   dimCol = Text.length();
              dimCol = 5*dimCol;
              x.append("<fo:table-column column-width='");
              x.append(dimCol);
              x.append("pt'/>n");
         }while(wdContext.nodeColumnSelezionati().moveNext() != null);
         x.append("<fo:table-body>n");
         x.append("<fo:table-row>n");
         //  COLONNA DEFAULT per EQUIPMENT
         x.append("<fo:table-cell  padding-top="1pt" padding-left="1pt"  border-bottom="solid black 1px" border-right="solid black 1px" >n");
         x.append("  <fo:block >n");
         x.append("Equipment");
         x.append("</fo:block>n");
         x.append("</fo:table-cell>n");
         //intestazioni colonne
         wdContext.nodeColumnSelezionati().moveFirst();
              do {
                   Text = wdContext.currentColumnSelezionatiElement().getText();
                   Text = Text.substring(0,Text.lastIndexOf("("));
                   x.append("<fo:table-cell  padding-top="1pt" padding-left="1pt"  border-bottom="solid black 1px" border-right="solid black 1px" >n");
                   x.append("  <fo:block >n");
                   x.append(Text);
                   x.append("</fo:block>n");
                   x.append("</fo:table-cell>n");
              }while(wdContext.nodeColumnSelezionati().moveNext() != null);
         x.append("</fo:table-row>n");
         //contenuto colonne
         wdContext.nodeIt_Equnr().moveFirst();
         do{
              //individuo se è una main oppure una sub tramite il campo lev
              Text = wdContext.currentIt_EqunrElement().getAttributeAsText("Lev");
              if (Text.equals("MAIN")){
                   x.append("<fo:table-row>n");
                             //          COLONNA DEFAULT per EQUIPMENT
                             x.append("<fo:table-cell   padding-top="1pt" padding-left="1pt"  border-bottom="solid black 1px" border-right="solid black 1px" >n");
                             x.append("  <fo:block >n");
                             Text = wdContext.currentIt_EqunrElement().getEquipment();
                             while (Text.charAt(0) == '0')
                                  Text = Text.substring(1);
                             x.append(Text);
                             x.append("</fo:block>n");
                             x.append("</fo:table-cell>n");
              }else{
                   x.append("<fo:table-row>n");
                   //          COLONNA DEFAULT per EQUIPMENT
                             x.append("<fo:table-cell   padding-top="1pt" padding-left="6pt"  border-bottom="solid black 1px" border-right="solid black 1px" >n");
                             x.append("  <fo:block >n");
                             Text = wdContext.currentIt_EqunrElement().getEquipment();
                             while (Text.charAt(0) == '0')
                                  Text = Text.substring(1);
                             x.append(Text);
                             x.append("</fo:block>n");
                             x.append("</fo:table-cell>n");
              wdContext.nodeColumnSelezionati().moveFirst();
              do {
                   x.append("<fo:table-cell   padding-top="1pt" padding-left="1pt"  border-bottom="solid black 1px" border-right="solid black 1px" >n");
                   x.append("  <fo:block >n");
                   Text = wdContext.currentColumnSelezionatiElement().getNameCol();
                   Text = wdContext.currentIt_EqunrElement().getAttributeAsText(Text);
                   x.append(traduciHTML(Text));
                   x.append("</fo:block>n");
                   x.append("</fo:table-cell>n");
              }while(wdContext.nodeColumnSelezionati().moveNext() != null);
              x.append("</fo:table-row>n");
         }while(wdContext.nodeIt_Equnr().moveNext() != null);
         x.append("</fo:table-body>n");
         x.append("</fo:table>n");
         x.append("</fo:block>n");
         x.append("</fo:flow>n");
         x.append("</fo:page-sequence>n");
         x.append("</root>n");
         wdContext.nodeIt_Equnr().moveFirst();
         wdContext.nodeColumnSelezionati().moveFirst();
         return x.toString();
    METHOD
    getBytesFromFile
    public static byte[] getBytesFromFile(File file) throws IOException {
                 InputStream is = new FileInputStream(file);
                 // Get the size of the file
                 long length = file.length();
                 // You cannot create an array using a long type.
                 // It needs to be an int type.
                 // Before converting to an int type, check
                 // to ensure that file is not larger than Integer.MAX_VALUE.
                 if (length > Integer.MAX_VALUE) {
                      // File is too large
                 // Create the byte array to hold the data
                 byte[] bytes = new byte[(int)length];
                 // Read in the bytes
                 int offset = 0;
                 int numRead = 0;
                 while (offset < bytes.length
                          && (numRead=is.read(bytes, offset, bytes.length-offset)) >= 0) {
                      offset += numRead;
                 // Ensure all the bytes have been read in
                 if (offset < bytes.length) {
                      throw new IOException("Could not completely read file "+file.getName());
                 // Close the input stream and return bytes
                 is.close();
                 return bytes;
    METHOD
    getCachedWebResource
    private IWDCachedWebResource getCachedWebResource(byte[] file, String name, WDWebResourceType type) {
          IWDCachedWebResource cachedWebResource = null;
          if (file != null) {
            cachedWebResource = WDWebResource.getWebResource(file, type);
            cachedWebResource.setResourceName(name);
          return cachedWebResource;
    IMPORT:
    import java.io.File;
    import java.io.FileInputStream;
    import java.io.FileNotFoundException;
    import java.io.IOException;
    import java.io.InputStream;
    import java.io.OutputStream;
    import java.io.UnsupportedEncodingException;
    import java.util.Calendar;
    import java.util.TimeZone;
    import org.apache.avalon.framework.logger.ConsoleLogger;
    import org.apache.avalon.framework.logger.Logger;
    import org.apache.fop.apps.Driver;
    import org.apache.fop.apps.FOPException;
    import org.apache.fop.messaging.MessageHandler;
    import org.xml.sax.InputSource;
    import com.sap.tc.webdynpro.services.sal.deployment.api.WDDeployableObjectPart;
    import com.sap.tc.webdynpro.services.sal.url.api.IWDCachedWebResource;
    import com.sap.tc.webdynpro.services.sal.url.api.WDURLException;
    import com.sap.tc.webdynpro.services.sal.url.api.WDURLGenerator;
    import com.sap.tc.webdynpro.services.sal.url.api.WDWebResource;
    import com.sap.tc.webdynpro.services.sal.url.api.WDWebResourceType;
    The method CreaFilePDF writes on a value attribute
    foText in Context Interf. Controller. 
    Regards.
    Gianluca Barile

  • How to return one ROW with Multiple value seperated by Colon in a SQL Query

    Hi,
    I have a SQL query as mentioned.
    select deptno
      from deptI want to mofidfy this query, so that this should return me department list with colon delimeted in one ROW.
    10:20:30:40.......Thanks,
    Deepak

    In 10g:
    select rtrim(xmlagg(xmlparse(content deptno || ':')).getstringval(), ':') data
    from   dept;
    DATA                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            
    10:20:30:40with apologies for the abuse of XML...

  • How to convert colon separated column values in multiple rows in report

    Hi All,
    I want to display colon separated values from a column, in a multi row in report.
    For example i have a column1 in a table with value 'A:B:C' , column2 has value '1'.
    i want to show in a report three rows using these two columns like
    column1 column2
    A 1
    B 1
    C 1

    Here's one way:
    SQL> create table test (col1 varchar2(20), col2 number);
    Table created.
    SQL> insert all
      2    into test values ('A:B:C', 1)
      3    into test values ('Dg:Ezs', 2)
      4  select * from dual;
    2 rows created.
    SQL> select
      2    t.col2,
      3    regexp_substr(t.col1, '\w+', 1, t2.column_value) c1
      4  from test t,
      5    table(cast(multiset(select level
      6                        from dual
      7                        connect by level <= length(t.col1) - length(replace(t.col1, ':', '')) + 1
      8                       ) as sys.odcinumberlist )) t2
      9  order by 2, 1;
          COL2 C1
             1 A
             1 B
             1 C
             2 Dg
             2 Ezs
    SQL>Edited by: Littlefoot on Jan 31, 2012 10:13 AM

  • Horizontal row with a colon delimited field. need vertical row

    have data like this
    X Y
    A 1
    A 2
    B 3
    C 4
    A 5
    A 6
    A 7
    B 8
    A 9
    need row to look like this
    X Y
    A 1-2,5-7,9
    B 3,8
    C 4
    Message was edited by:
    user558929

    And another one with minimal nesting but without regexp (9i):
    with t as
    ( select case when level = 4 then 'C' when level in (3, 8) then 'B' else 'A' end as x, level as y
        from duaL connect by level <= 9
    select x,
        max
        ( replace
          ( sys_connect_by_path
            ( decode
              ( y, prev_y + 1, decode(y, next_y - 1, '', y),
                               decode(prev_y, '', '', ',') || y || decode(y, next_y - 1, '-')
              '~'
            '~'
        ) as y
      from
      ( select x, y, lag (y) over (partition by x order by y) as prev_y,
                     lead(y) over (partition by x order by y) as next_y
          from t
      start with prev_y is null
      connect by x = prior x and prev_y = prior y
      group by x
    X Y
    A 1-2,5-7,9
    B 3,8
    C 4

  • Why prefix variables names with a colon?

    PROCEDURE calc_avg_sales
    BEGIN
    :sales.avg := :sales.month1 / :sales.total;
    EXCEPTION WHEN ZERO_DIVIDE THEN
    :sales_avg := 0;
    RAISE FORM_TRIGGER_FAILURE;
    WHEN OTHERS THEN NULL;
    END;
    Excerpt from Oracle PL/SQL Programming ISBN 0-596-00381-1 Pg. 106
    Why are the variable :sales.avg, :sales.month1, and, :sales.total not declared in the above snippet? Is it presumed that they have been? Why is a : (colon) placed in front of the variables?
    Why would you think that FORM_TRIGGER_FAILURE is raised rather than ZERO_DIVIDE?
    Within my production environment I have noticed that error messages are sometimes vague to the user and for the technical user, and, would like to make use of an error table which would help technical support troubleshoot the cause of the error, without giving unnecessary details to the end user. Ideally this would include details of the Java Exceptions raised (usually large stacks) within applications that form part of the software architecture. How would you go about using an error handling mechanism?
    Edited by: Jon80 on Jun 24, 2012 2:02 PM

    Hi,
    Jon80 wrote:
    PROCEDURE calc_avg_sales
    BEGIN
    :sales.avg := :sales.month1 / :sales.total;
    EXCEPTION WHEN ZERO DIVIDE THEN
    :sales_avg := 0;
    RAISE FORM_TRIGGER_FAILURE;
    WHEN OTHERS THEN NULL;
    END;
    Excerpt from Oracle PL/SQL Programming ISBN 0-596-00381-1 Pg. 106
    Why are the variable :sales.avg, :sales.month1, and, :sales.total not declared in the above snippet? Is it presumed that they have been? Why is a : (colon) placed in front of the variables?Variables that start with a colon act like global variables; they can be defined in a larger scope. The colon helps the compiler identify them as not necessarily being defined in the unit being compiled.
    Why would you think that FORM_TRIGGER_FAILURE is raised rather than ZERO_DIVIDE?Actually, I would expect PLS-00103 Encountered the symbol "DIVIDE" when expecting one of the following ..., because you have a space (ZERO DIVIDE) instead of an underscore (ZERO_DIVIDE). Cut and paste actual code when posting here.
    If you correct that, then ZERO_DIVIDE is raised in the procedure. An EXCEPTION handler keeps some errors that occur at run-time from being reported to the caller. In this case, the EXCEPTION handler is saying "Don't report ZERO_DIVIDE as an error. Instead, do this ...". In this example, part of what it is doing instead is raising a different error, and that's the only error that is reported to the caller.
    By the way, "WHEN OTHERS THEN NULL" is almost always a very bad thing to say.
    Within my production environment I have noticed that error messages are sometimes vague to the user and for the technical user, and, would like to make use of an error table which would help technical support troubleshoot the cause of the error, without giving unnecessary details to the end user. Ideally this would include details of the Java Exceptions raised (usually large stacks) within applications that form part of the software architecture. How would you go about using an error handling mechanism?One thing Oracle often does is print short, vague error messages on the screen, but write long, detailed messages in trace files on the database server. Programmers are instructed to look for a trace file when they see certain error messages. You might do something similar. Instead of (or in addition to) writing trace files, you could insert rows into an error-logging table.

  • Update all rows in a View Column via one Apex Form field

    Appreciate any helpful answers to this query.
    I have an Apex App (4.x) where I have a view: PRICE_MODEL_CRA_V
    In the view, I have the following applicable columns:
    COUNTRY
    GRADE
    SALARY
    In the form I have the following fields
    :P16_COUNTRY (DROPDOWN)
    :P16_GRADE (DROPDOWN)
    :P16_SALARY (Number)
    In my app, I have a form with an Update button. I am simply trying to get Apex to update all rows in the salaray column in the view, where the country and grade match.
    I've the following code for the Update button:
    UPDATE PRICE_MODEL_CRA_V
    SET SALARY = :P16_SALARY
    WHERE COUNTRY = :P16_COUNTRY
    AND GRADE = :P16_GRADE
    The option I have chosen in condition type is:
    Value of Item / Column expression is NOT Null (as there are values in the column)
    Also tried SQL Expression and it does not like..says that there is No Expression.
    Thanks again if anyone can help :)

    Hi,
    Sorry I realize now that piece of information was not well supported.
    If I choose SQL Expression for Condition Type in my Form Page and I try to Apply Changes
    Apex says this..
    •Failed to parse SQL query!
    ORA-00936: missing expression
    I was assuming that I need to have the colon for the items in the form where I am wanting Apex to grab the values entered by the user. I tried them without the colons with the SQL Expression condition and same result.
    UPDATE PRICE_MODEL_CRA_V
    SET SALARY = P16_SALARY
    WHERE COUNTRY = P16_COUNTRY
    AND GRADE = P16_GRADE
    I did put 1-1/0 in my expression field and applied changes and then tried ot submit the form and it does not produce an error, so perhaps it is not being called? Where would I start with troubleshooting that?
    Thanks,

  • Deleting a row from my Jtable

    I have MyTableModel class:
    class MyTableModel extends AbstractTableModel{
             private Object columnNames[];
             private Object[][] data;
             public MyTableModel(Vector colonne, Vector corpoTabella){
                  columnNames= new Object[colonne.size()];
                  int nRighe=corpoTabella.size()/colonne.size();
                  data=new Object[nRighe][colonne.size()];
                  //inizializzo l'intestazione della tabella:
                  columnNames= colonne.toArray();
                  //inizializzo il corpo della tabella
                  for(int i=0, k=0;i<nRighe;i++){
                       for(int j=0;j<colonne.size();j++){
                            data[i][j]=corpoTabella.get(k);
                            k++;
            public int getColumnCount() {
                return columnNames.length;
           public int getRowCount() {
                return data.length;
            public String getColumnName(int col) {
                return String.valueOf(columnNames[col]);
            public Object getValueAt(int row, int col) {
                return data[row][col];
            public boolean isCellEditable(int row, int col) {
                    return false;
        }And I use it to create a JTable:
    table=new JTable(new MyTableModel(colonne,corpo));I read on the tutorial to delete a row I have to use the DefaultTableModel in order to activate the removeRow method, but now how could I implementate it to delete rows?

    ok now I have:
    modelloTab=new MyTableModel(colonne,corpo);
    table=new JTable(modelloTab);
    class MyTableModel extends DefaultTableModel{
    so I can write without errors:modelloTab.removeRow(0)but despite I wrote a lot of rows in the table when I run it I have a java.lang.ArrayIndexOutOfBoundsException ...what can I do?
    Edited by: cassio_steel on Aug 25, 2008 1:52 AM
    Edited by: cassio_steel on Aug 25, 2008 1:56 AM                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

  • Selecting a set of rows in an Interactive Report

    Hi,
    What I want to achieve is when a row is clicked in an interactive report that row (via a Primary Key/ROWID) is added to a list of IDs to be edited in one go, I will probably use a collection for this, although a colon delimited list might be quicker and/or easier. The two ways I thought of trying to achieve this was by bending the use of the Link Column and providing a Link to Custom Target or using a row selection technique described below.
    My initial thought was to make it a check box which then called some JavaScript/On demand process, similar to the one shown here. So far I've tricked it by making the image my check box and the link attributes being my function which returns false to stop the page redirecting when clicked. The problem is I can't seem to get the ROWID to appear, I've tried #ROWID# which simply puts that string as the input, so for example, my "image" is this: <input type="checkbox" value="#PK_ID#" name="f01"/>So, if I could get something meaningful in there instead of ROWID it would work a treat I think.
    The alternative method was to use a form of the row highlighting described in this Row Highlighting. The problem here seems to be that for an Interactive Report you cannot change the table row elements to add the onclick. Also when trying this (using Firefox to add the appropriate code to a TR element) it works, as in the function fires, but does not change the appearance of the rows. I lack the CSS/HTML skills to work out why so far.
    Worst case I can simply create a checkbox field in the query as per the example above, the only drawback is that the column might not always be available in the report if the user has hidden the column.
    Any ideas?
    Many thanks,
    Gareth.
    Edited by: gaz_stephens on Jan 16, 2009 12:09 PM

    Hi,
    If all of the records are displayed on the report in one go (that is, there is no pagination involved), then you can add the onclick after the table has been created. Add the following into the report's Region Footer setting:
    &lt;script type="text/javascript"&gt;
    function addEvents()
    var t = document.getElementById(gTable);
    var tRows = t.rows;
    var k;
    for (k = 1; k &lt; tRows.length; k++)
      tRows[k].onclick = function() {alert('Here');};
    addEvents();
    &lt;/script&gt;If pagination is involved, then any javascript will not be run when the next page is displayed. The alert('Here'); in the code would need to be replaced with some javascript functionality - probably calling a javascript function that works on the TR's "this" object reference.
    Andy

  • Vertical One Row Report

    Hi Everyone,
    I am trying to implement a SQL report and want it to be as Vertical One Row. I've found one solution which would work perfectly for me in here:
    [http://apex.oracle.com/pls/otn/f?p=11933:108]
    It displays one row at a time and it is vertical, basically that is what I need. The problem here is that I cannot make it working. I did everything according to instructions: did create a new report template as "Named Column (row template)", inserted code into "Row Template 1" and "Before Rows" and "After Rows". Have my SQL report ready as "No Template" in "Page Definition" . In "Layout and Pagination" set to my new report template. As a result it gave me that look and feel but no pagination so I can see 1 row at a time, Instead I see all my rows the same way as I would use "default: vertical" template. Any Ideas????
    Is there any other way to implement this?
    Thanks

    Hi,
    I am glad it is working now. But I was wondering if logging out and in again would help in this case... If the current pagination settings are stored against the username (rather than the session), logging out and in would not make a difference. Based on what you described, that may be the case.
    I think the best approach is the one indicated by fac586. The problem is that I can never remember after which colon to put that RP string!
    Luis

  • How do you set the number of rows in a spreadsheet, so that even when you drag data in, in writes over those rows instead of adding a new row?

    How do you set the number of rows you want in a spreadsheet, so that even when you drag data in, in writes over those rows instead of adding a new row?

    After the discovery reported above, I filed this report :
    Bug ID# 10073038
    Summary:
    When Numbers is used on a system with decimal comma a csv file may be good AND wrong
    Steps to Reproduce:
    With Numbers v2, you introduced an interesting enhancement.
    In system using the comma as decimal separator, Numbers requires csv files using the semi-colon as values delimiter.
    In fact it’s true if we OPEN the document dragging its icon on Numbers one or thru the open dialog.
    This said.
    (1) Drag and drop a csv built with the 'semi-colon' standard on a table or on a sheet
    (2) Drag and drop a csv built with the 'comma' standard on a table or on a sheet
    Expected Results:
    Every normally constituted user assume that in
    case (1) he will get a perfectly built table
    case (2) he will get every cells of a row in a single cell
    Actual Results:
    In fact you forgot the drag and drop way of use and in
    case (1) every values separated by semi-colon are inserted in a single cell
    case (2) values separated by comma are correctly spread in a table
    isn’t it ridiculous ?
    Regression:
    Except looking in  QuickView to see which is exactly the structure of the file to decide the way we will insert it in a Numbers document, we may use an applescript fair enough to replace the semi-colons by TAB characters
    or
    to replace the commas by TABs and the decimal periods by commas
    Notes:
    While I am on this subject, I wish to make two proposals:
    (1)  It would be fine to format the date according to the ISO format year-mm-dd when you export a Numbers doc to csv.
    Doing that, dates would be imported correctly in every countries.
    At this time, on an English system, you export as mm/dd/year.
    If the doc is open on a system using the format dd/mm/year, the results will be odd.
    On a system using the format dd/mm/year, you export this way and so, if the doc is open on a system using the format mm/dd/year the results are odd too.
    As every localized versions accept the ISO format (at least on entry), using it in the export scheme would give a correct behavior everywhere.
    (2) It would be fine to add the format Tab Separated Values in the Export pane.
    TSV + ISO date format would give documents opening flawlessly everywhere.
    Yvan KOENIG (VALLAURIS, France) dimanche 4 septembre 2011 21:27:41
    iMac 21”5, i7, 2.8 GHz, 4 Gbytes, 1 Tbytes, mac OS X 10.6.8 and 10.7.0
    My iDisk is : <http://public.me.com/koenigyvan>
    Please : Search for questions similar to your own before submitting them to the community

  • How to insert single colon xml text in the xml table

    Dear Sir,
    how to insert special characters like single colon text example (don't) xml text in to the xml table
    please see the following example its giving me error quoted string is not ended properly
    SQL> insert into ftr_ctl values (1,
    2 xmltype('<po:root xmlns:po="http://www.oracle.com/FC.xsd"
    3 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    4 xsi:schemaLocation="http://www.oracle.com/FC.xsd
    5 http://www.oracle.com/FC.xsd">
    6 <row>
    7 <UniqueIdentifier>urn:x-gcs:def:featureType:GFDD::FT_DFDD_100565</UniqueIdentifier>
    8 <AlphaCode>ZB032</AlphaCode>
    9 <Name>Baseline Point</Name>
    10 <Status>Submitted</Status>
    11 <Definition>A location that serves as a point on, and which partially defines a segment
    of, a national boundary baseline.</Definition>
    12 <Description>May be monumented or unmonumented. A national boundary baseline is used fo
    r defining the landward edge or margin of a nation's various contiguous zones such as the 3 and 12 n
    autical mile limits and the Exclusive Economic Zone (EEZ).</Description>
    13 </row>
    14 </po:root>'));
    ERROR:
    ORA-01756: quoted string not properly terminated
    how to solve single quotation like (nation's) in xml data insertion
    please give me reply as soon as possible
    Thanks
    Kabeer

    Hi,
    Use &#x7B;code} tags to post formatted code on the forum.
    That way, your code will be more readable for everyone, and more importantly here, everyone will be able to clearly see what's bothering you :
    &apos;sThe single quote was encoded with the character entity reference "&amp;apos;".
    The conversion is not mandatory but it happens Oracle is doing it in this case.
    It shouldn't be a problem though.
    If you want to extract the value afterwards, it'll come as expected :
    SQL> create table ftr_ctl (id number, doc xmltype);
    Table created
    SQL> insert into ftr_ctl values (1,
      2  xmltype('<po:root xmlns:po="http://www.oracle.com/FC.xsd"
      3  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      4  xsi:schemaLocation="http://www.oracle.com/FC.xsd
      5  http://www.oracle.com/FC.xsd">
      6  <row>
      7  <UniqueIdentifier>urn:x-gcs:def:featureType:GFDD::FT_DFDD_100565</UniqueIdentifier>
      8  <AlphaCode>ZB032</AlphaCode>
      9  <Name>Baseline Point</Name>
    10  <Status>Submitted</Status>
    11  <Definition>A location that serves as a point on, and which partially defines a segment of, a national boundary baseline.</Definition>
    12  <Description>May be monumented or unmonumented. A national boundary baseline is used for defining the landward edge or margin of a nation''s various contiguous zones such as the 3 and 12 nautical mile limits and the Exclusive Economic Zone (EEZ).</Description>
    13  <Alias xsi:nil="true"></Alias>
    14  <SourceItemIdentifier>100565</SourceItemIdentifier>
    15  <SourceReference>DGIWG DFDD BL 2011-1.00</SourceReference>
    16  <SourceURL>https://www.dgiwg.org/FAD/fdd/view?i=100565</SourceURL>
    17  </row>
    18  </po:root>'));
    1 row inserted
    SQL> select extractvalue(doc, '/po:root/row/Description','xmlns:po="http://www.oracle.com/FC.xsd"')
      2  from ftr_ctl
      3  where id = 1
      4  ;
    EXTRACTVALUE(DOC,'/PO:ROOT/ROW/DESCRIPTION','XMLNS:PO="HTTP://WWW.ORACLE.COM/FC.
    May be monumented or unmonumented. A national boundary baseline is used for defi
    ning the landward edge or margin of a nation's various contiguous zones such as
    the 3 and 12 nautical mile limits and the Exclusive Economic Zone (EEZ).
    {code}                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

  • Problem with SAX parser - entity must finish with a semi-colon

    Hi,
    I'm pretty new to the complexities of using SAXParserFactory and its cousins of XMLReaderAdapter, HTMLBuilder, HTMLDocument, entity resolvers and the like, so wondered if perhaps someone could give me a hand with this problem.
    In a nutshell, my code is really nothing more than a glorified HTML parser - a web page editor, if you like. I read in an HTML file (only one that my software has created in the first place), parse it, then produce a Swing representation of the various tags I've parsed from the page and display this on a canvas. So, for instance, I would convert a simple <TABLE> of three rows and one column, via an HTMLTableElement, into a Swing JPanel containing three JLabels, suitably laid out.
    I then allow the user to amend the values of the various HTML attributes, and I then write the HTML representation back to the web page.
    It works reasonably well, albeit a bit heavy on resources. Here's a summary of the code for parsing an HTML file:
          htmlBuilder = new HTMLBuilder();
    parserFactory = SAXParserFactory.newInstance();
    parserFactory.setValidating(false);
    parserFactory.setNamespaceAware(true);
    FileInputStream fileInputStream = new FileInputStream(htmlFile);
    InputSource inputSource = new InputSource(fileInputStream);
    DoctypeChangerStream changer = new DoctypeChangerStream(inputSource.getByteStream());
    changer.setGenerator(
       new DoctypeGenerator()
          public Doctype generate(Doctype old)
             return new DoctypeImpl
             old.getRootElement(),
                              old.getPublicId(),
                              old.getSystemId(),
             old.getInternalSubset()
          resolver = new TSLLocalEntityResolver("-//W3C//DTD XHTML 1.0 Transitional//EN", "xhtml1-transitional.dtd");
          readerAdapter = new XMLReaderAdapter(parserFactory.newSAXParser().getXMLReader());
          readerAdapter.setDocumentHandler(htmlBuilder);
          readerAdapter.setEntityResolver(resolver);
          readerAdapter.parse(inputSource);
          htmlDocument = htmlBuilder.getHTMLDocument();
          htmlBody = (HTMLBodyElement)htmlDocument.getBody();
          traversal = (DocumentTraversal)htmlDocument;
          walker = traversal.createTreeWalker(htmlBody,NodeFilter.SHOW_ELEMENT, null, true);
          rootNode = new DefaultMutableTreeNode(new WidgetTreeRootNode(htmlFile));
          createNodes(walker); However, I'm having a problem parsing a piece of HTML for a streaming video widget. The key part of this HTML is as follows:
                <object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
                  id="client"
            width="100%"
            height="100%"
                  codebase="http://fpdownload.macromedia.com/get/flashplayer/current/swflash.cab">
                  <param name="movie" value="client.swf?user=lkcl&stream=stream2&streamtype=live&server=rtmp://192.168.250.206/oflaDemo" />
             etc....You will see that the <param> tag in the HTML has a value attribute which is a URL plus three URL parameters - looks absolutely standard, and in fact works absolutely correctly in a browser. However, when my readerAdapter.parse() method gets to this point, it throws an exception saying that there should be a semi-colon after the entity 'stream'. I can see whats happening - basically the SAXParser thinks that the ampersand marks the start of a new entity. When it finds '&stream' it expects it to finish with a semi-colon (e.g. much like and other such HTML characters). The only way I can get the parser past this point is to encode all the relevant ampersands to %26 -- but then the web page stops working ! Aaargh....
    Can someone explain what my options are for getting around this problem ? Some property I can set on the parser ? A different DTD ? Not to use SAX at all ? Override the parser's exception handler ? A completely different approach ?!
    Could you provide a simple example to explain what you mean ?
    Thanks in anticipation !

    You probably don't have the ampersands in your "value" attribute escaped properly. It should look like this:
    value="client.swf?user=lkcl&stream=...{code}
    Most HTML processors (i.e. browsers) will overlook that omission, because almost nobody does it right when they are generating HTML by hand, but XML processors won't.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

  • How to combine rows with small numbers into single "other" row?

    How can I combine rows with value 6(for example) or lower to single row representing the SUM of all this values and label OTHER, so the pie chart will have a chance to display all small values combined?
    I'm using Numbers 09

    HI Peter,
    When you write a decimal number, is the decimal separator a period ( . ) or a comma ( , )? If it's a comma, then the syntax error can be corrected by replacing the list separator in the formula, a comma in Jerry's formula, with a semi colon ( ; ):
    =SUMIF(B; "<6"; B)
    (Added): The two Bs appear in blue 'lozenges' in Jerry's image because that is the way cell (or column) references are displayed in Numbers when a formula has correct syntax.
    Regards,
    Barry
    Message was edited by: Barry

Maybe you are looking for