XML DB: using default namespace gives different result

In Oracle9i R2 I created an XMLTYPE table based on a XML schema. The schema uses a namespace. When I insert an instance document that has a namespace prefix for every element querying works fine. When I insert an instance document that has the namespace defined as the default namespace, the query returns an empty row for that document. It seems to me that before storing the document the namespaces must be expanded and hence there should be no difference between the two documents and the query should return a value for both rows. Any thoughts? Thanks in advance! Below is the script and the results of the queries.
==========
THE SCRIPT
==========
DROP TABLE islands_xsd
BEGIN
DBMS_XMLSCHEMA.DELETESCHEMA('http://www.cumquat.nl/xsd/island.xsd', DBMS_XMLSCHEMA.DELETE_CASCADE);
END;
BEGIN
DBMS_XMLSCHEMA.REGISTERSCHEMA('http://www.cumquat.nl/xsd/island.xsd',
'<?xml version="1.0"?>
<schema targetNamespace="http://www.cumquat.nl/xsd/island.xsd"
xmlns:isl="http://www.cumquat.nl/xsd/island.xsd"
xmlns="http://www.w3.org/2001/XMLSchema">
<element name="island" type="isl:islandType"/>
<complexType name="islandType">
<sequence>
<element name="name" type="string"/>
<element name="country" type="string"/>
<element name="total_area" type="positiveInteger"/>
<element name="shoreline" type="positiveInteger"/>
<element name="pop_density" type="integer"/>
<element name="dist_continent" type="integer"/>
</sequence>
</complexType>
</schema>');
END;
CREATE TABLE islands_xsd OF XMLTYPE
XMLSCHEMA "http://www.cumquat.nl/xsd/island.xsd"
ELEMENT "island"
INSERT INTO islands_xsd VALUES (XMLTYPE(
'<?xml version="1.0"?>
<isl:island xmlns:isl="http://www.cumquat.nl/xsd/island.xsd"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.cumquat.nl/xsd/island.xsd http://www.cumquat.nl/xsd/island.xsd">
<isl:name>Aldabra</isl:name>
<isl:country>Seychelles</isl:country>
<isl:total_area>13</isl:total_area>
<isl:shoreline>104</isl:shoreline>
<isl:pop_density>0</isl:pop_density>
<isl:dist_continent>6</isl:dist_continent>
</isl:island>'))
INSERT INTO islands_xsd VALUES (XMLTYPE(
'<?xml version="1.0"?>
<island xmlns="http://www.cumquat.nl/xsd/island.xsd"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.cumquat.nl/xsd/island.xsd http://www.cumquat.nl/xsd/island.xsd">
<name>Amsterdam</name>
<country>France</country>
<total_area>9</total_area>
<shoreline>51</shoreline>
<pop_density>0</pop_density>
<dist_continent>30</dist_continent>
</island>'))
SELECT i.EXTRACT('/isl:island/isl:name', 'xmlns:isl="http://www.cumquat.nl/xsd/island.xsd"')
FROM islands_xsd i
SELECT i.EXTRACT('/isl:island/isl:name', 'xmlns:isl="http://www.cumquat.nl/xsd/island.xsd"').GETSTRINGVAL()
FROM islands_xsd i
SELECT i.EXTRACT('/isl:island/isl:name/text()', 'xmlns:isl="http://www.cumquat.nl/xsd/island.xsd"').GETSTRINGVAL()
FROM islands_xsd i
=======================================
THE RESULTS OF RUNNING THE QUERIES
=======================================
SQL> SELECT i.EXTRACT('/isl:island/isl:name', 'xmlns:isl="http://www.cumquat.nl/xsd/island.xsd"')
2 FROM islands_xsd i
3 /
I.EXTRACT('/ISL:ISLAND/ISL:NAME','XMLNS:ISL="HTTP://WWW.CUMQUAT.NL/XSD/ISLAND.XS
XMLTYPE()
2 rows selected.
SQL> SELECT i.EXTRACT('/isl:island/isl:name', 'xmlns:isl="http://www.cumquat.nl/xsd/island.xsd"').GE
TSTRINGVAL()
2 FROM islands_xsd i
3 /
I.EXTRACT('/ISL:ISLAND/ISL:NAME','XMLNS:ISL="HTTP://WWW.CUMQUAT.NL/XSD/ISLAND.XS
<isl:name xmlns:isl="http://www.cumquat.nl/xsd/island.xsd">Aldabra</isl:name>
2 rows selected.
SQL> SELECT i.EXTRACT('/isl:island/isl:name/text()', 'xmlns:isl="http://www.cumquat.nl/xsd/island.xs
d"').GETSTRINGVAL()
2 FROM islands_xsd i
3 /
I.EXTRACT('/ISL:ISLAND/ISL:NAME/TEXT()','XMLNS:ISL="HTTP://WWW.CUMQUAT.NL/XSD/IS
Aldabra
2 rows selected.

This seems wrong to me. I've filed Bug 2400119 to get this looked into by development.
I'd expect any document with an appropriate qualified name to be found by your XPath expression, irrespective of whether syntactically one of the documents happened to use the default namespace syntax.

Similar Messages

  • Do IMAQ Cast Image or IMAQ Linear averages give different results when using different computers that are running under Windows XP ?

    Hello
    I'm currently developping an image processing algorithm using Labview 7.1 and the associated IMAQ Vision tools. After several tests, I found a weird result. Indeed, I put the labview algorithm - including the IMAQ VI on the library to get sure that I use all the time the same VI - on my memory stick and used it on two different computers. I tested the same picture (still in my memory stick) and had two very different results.
    After several hours trying to understand why, I found that there were a difference between the results given by both computers at the very begining of the algorithm. Indeed, I used a JPEG file.
    To open it, I first create an Image with IMAQ Create (U8). Then, I open it.
    Then in my first sub-VI, I use IMAQ Cast Image to be sure that the picture is a U8 grayscale picture.
    Right after that, I use the IMAQ Linear Averages. The results of this VI are different on the two computers.
    I tried several time on the same picture : one computer always give me the same result but the two computers give me a different result. So there is no random variable on the results.
    So my question is : Do IMAQ Cast Image or IMAQ Linear averages give different results when using different computers that are running under Windows XP ?
    My bet is on IMAQ Cast Image but I'm not quite sure and I do not undestand why. The labview and IMAQ are the same on both computers.
    The difference between the two computer are above :
    Computer 1 :
    Pentium(R) 4 CPU 3.20GHz with a RAM of 1Go. The processor is an Intel(R).
    The OS is windows XP Pro 2002
    Computer 2 :
    Pentium(R) 4 CPU 2.80GHz with a RAM of 512Mo. The processor is an Intel(R).
    The OS is windows XP Pro 2002.
    If anybody can help me on this problem, it would be really helpful.
    Regards
    Florence P.

    Hi,
    Indeed it's a strange behaviour, could you send me your VI and your JPEG file, (or another file that reproduces) so that I could check this inthere ?
    I'll then try to find out what's happening.
    Regards
    Richard Keromen
    National Instruments France
    #adMrkt{text-align: center;font-size:11px; font-weight: bold;} #adMrkt a {text-decoration: none;} #adMrkt a:hover{font-size: 9px;} #adMrkt a span{display: none;} #adMrkt a:hover span{display: block;}
    >> Découvrez, en vidéo, les innovations technologiques réalisées en éco-conception

  • Format using default namespace prefix.

    Is there any way to format XML using default namespace prefix in an expression?
    My expression is as follows:
    oraext:get-content-as-string(bpws:getVariableData('JmsMdx_InputVariable','body'))

    This seems wrong to me. I've filed Bug 2400119 to get this looked into by development.
    I'd expect any document with an appropriate qualified name to be found by your XPath expression, irrespective of whether syntactically one of the documents happened to use the default namespace syntax.

  • Output XML with a default namespace using XQuery

    I'm having a problem with namespaces in an XQuery within ALSB.
    We receive XML from a file which doesn't have any namespace and have to transform it into a different structure, giving it a default namespace such as below:
    Input XML
    <inputRoot>
         <inputAccountName>Joe Bloggs</inputAccountName>
         <inputAccountNumber>10938393</inputAccountNumber>
    </inputRoot>
    Desired output XML
    <outputRoot xmlns="http://www.example.org/outputSchema">
         <outputAccounts>
              <outputAccountName>Joe Bloggs</outputAccountName>
              <outputAccountNumber>10938393</outputAccountNumber>
         </outputAccounts>
    </outputRoot>
    When I attempt to do this using XQuery mapper tool, I end up with a namespace prefix on the outputRoot. The XQuery and result follows:
    XQuery
    declare namespace xf = "http://tempuri.org/XQueryProject/scratchTransformations/test/";
    declare namespace ns0 = "http://www.example.org/outputSchema";
    declare function xf:test($inputRoot1 as element(inputRoot))
    as element(ns0:outputRoot) {
    <ns0:outputRoot>
    <outputAccounts>
    <outputAccountName>{ data($inputRoot1/inputAccountName) }</outputAccountName>
    <outputAccountNumber>{ data($inputRoot1/inputAccountNumber) }</outputAccountNumber>
    </outputAccounts>
    </ns0:outputRoot>
    declare variable $inputRoot1 as element(inputRoot) external;
    xf:test($inputRoot1)
    Result
    <ns0:outputRoot xmlns:ns0="http://www.example.org/outputSchema">
         <outputAccounts>
              <outputAccountName>inputAccountName_1</outputAccountName>
              <outputAccountNumber>inputAccountNumber_1</outputAccountNumber>
         </outputAccounts>
    </ns0:outputRoot>
    How can I write the XQuery in such a way thay the namespace prefix isn't output? I've tried many different methods with no success. I can't declare a default element namespace because my input element doesn't have a namespace
    Thanks in advance

    I spoke too soon, it didn't work quite as perfectly as I'd thought :-) It turns out our client can't handle the xml with the namespace prefix but we've worked out the solution to return XML in the format we originally needed.
    Example below:
    XQuery
    declare namespace xf = "http://tempuri.org/XQueryProject/scratchTransformations/test/";
    declare default element namespace "http://www.example.org/outputSchema";
    declare namespace ns1 = ""
    declare function xf:test($inputRoot1 as element(ns1:inputRoot))
    as element(outputRoot) {
    <outputRoot>
    <outputAccounts>
    <outputAccountName>{ data($inputRoot1/inputAccountName) }</outputAccountName>
    <outputAccountNumber>{ data($inputRoot1/inputAccountNumber) }</outputAccountNumber>
    </outputAccounts>
    </outputRoot>
    declare variable $inputRoot1 as element(inputRoot) external;
    xf:test($inputRoot1)

  • How to parse XML document with default namespace with JDOM XPath

    Hi All,
    I am having difficulty parsing using Saxon and TagSoup parser on a namespace html document. The relevant content of this document are as follows:
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
    </head>
    <body>
        <div id="container">
            <div id="content">
                <table class="sresults">
                    <tr>
                        <td>
                            <a href="http://www.abc.com/areas" title="Hollywood, CA">hollywood</a>
                        </td>
                        <td>
                            <a href="http://www.abc.com/areas" title="San Jose, CA">san jose</a>
                        </td>
                        <td>
                            <a href="http://www.abc.com/areas" title="San Francisco, CA">san francisco</a>
                        </td>
                        <td>
                            <a href="http://www.abc.com/areas" title="San Diego, CA">San diego</a>
                        </td>
                  </tr>
    </body>
    </html>
    Below is the relevant code snippets illustrates how I have attempted to retrieve the contents (value of  <a>):
                 import java.util.*;
                 import org.jdom.*;
                 import org.jdom.xpath.*;
                 import org.saxpath.*;
                 import org.ccil.cowan.tagsoup.Parser;
    ( 1 )       frInHtml = new FileReader("C:\\Tmp\\ABC.html");
    ( 2 )       brInHtml = new BufferedReader(frInHtml);
    ( 3 ) //    SAXBuilder saxBuilder = new SAXBuilder("org.apache.xerces.parsers.SAXParser");
    ( 4 )       SAXBuilder saxBuilder = new SAXBuilder("org.ccil.cowan.tagsoup.Parser");
    ( 5 )       org.jdom.Document jdomDocument = saxbuilder.build(brInHtml);
    ( 6 )       XPath xpath =  XPath.newInstance("/ns:html/ns:body/ns:div[@id='container']/ns:div[@id='content']/ns:table[@class='sresults']/ns:tr/ns:td/ns:a");
    ( 7 )       xpath.addNamespace("ns", "http://www.w3.org/1999/xhtml");
    ( 8 )       java.util.List list = (java.util.List) (xpath.selectNodes(jdomDocument));
    ( 9 )       Iterator iterator = list.iterator();
    ( 10 )     while (iterator.hasNext())
    ( 11 )     {
    ( 12 )            Object object = iterator.next();
    ( 13 ) //         if (object instanceof Element)
    ( 14 ) //               System.out.println(((Element)object).getTextNormalize());
    ( 15 )             if (object instanceof Content)
    ( 16 )                   System.out.println(((Content)object).getValue());
    ….This program would work on the same document without the default namespace, hence, it would not be necessary to include “ns” prefix along in the XPath statements (line 6-7) either. Moreover, I was using “org.apache.xerces.parsers.SAXParser” to have successfully retrieve content of <a> from the same document without default namespace in the past.
    I would like to achieve the following objectives if possible:
    ( i ) Exclude DTD and namespace in order to simplifying the parsing process. How this could be done?
    ( ii ) If this is not possible, how to include it in XPath statements (line 6-7) so that the value of <a> is picked up correctly?
    ( iii ) Would changing from “org.apache.xerces.parsers.SAXParser” to “org.ccil.cowan.tagsoup.Parser” make any difference as far as using XPath is concerned?
    ( iv ) Failing to exlude DTD, how to change the lookup of a PUBLIC DTD to a local SYSTEM one and include a local DTD for reference?
    I am running JDK 1.6.0_06, Netbeans 6.1, JDOM 1.1, Saxon6-5-5, Tagsoup 1.2 on Windows XP platform.
    Any assistance would be appreciated.
    Thanks in advance,
    Jack

    Here's an example of using a custom EntityResolver with the standard DocumentBuilder provided by the JDK. The code may or may not be similar for the parsers that you're using.
    import java.io.IOException;
    import java.io.StringReader;
    import javax.xml.parsers.DocumentBuilder;
    import javax.xml.parsers.DocumentBuilderFactory;
    import org.w3c.dom.Document;
    import org.xml.sax.EntityResolver;
    import org.xml.sax.InputSource;
    import org.xml.sax.SAXException;
    public class ParseExamples
        private final static String COMMON_XML
            = "<music>"
            +     "<artist name=\"Anderson, Laurie\">"
            +         "<album>Big Science</album>"
            +         "<album>Strange Angels</album>"
            +     "</artist>"
            +     "<artist name=\"Fine Young Cannibals\">"
            +         "<album>The Raw & The Cooked</album>"
            +     "</artist>"
            + "</music>";
        private final static String COMMON_DTD
            = "<!ELEMENT music (artist*)>"
            + "<!ELEMENT artist (album+)>"
            + "<!ELEMENT album (#PCDATA)>"
            + "<!ATTLIST artist name CDATA #REQUIRED>";
        public static void main(String[] argv)
        throws Exception
            // this version uses just a SYSTEM identifier - note that it gets turned
            // into a file: URL
            String xml = "<!DOCTYPE music SYSTEM \"bar\">"
                       + COMMON_XML;
            // this version uses both PUBLIC and SYSTEM identifiers; the SYSTEM ID
            // gets munged, the PUBLIC ID doesn't
    //        String xml = "<!DOCTYPE music PUBLIC \"foo\" \"bar\">"
    //                   + COMMON_XML;
            DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
            dbf.setValidating(true);
            DocumentBuilder db = dbf.newDocumentBuilder();
            db.setEntityResolver(new EntityResolver()
                public InputSource resolveEntity(String publicId, String systemId)
                    throws SAXException, IOException
                    System.out.println("publicId = " + publicId);
                    System.out.println("systemId = " + systemId);
                    return new InputSource(new StringReader(COMMON_DTD));
            Document dom = db.parse(new InputSource(new StringReader(xml)));
            System.out.println("root element name = " + dom.getDocumentElement().getNodeName());
    }

  • Same code gives different results in Matlab Script in Labview and Matlab

    I am implemeting a Matlab code into a LabVIEW application using Matlab script. When I import the exactly same code to the Matlab Script in LabVIEW it gives a different result than it is in Matlab. This code is a simulation code including first kind bessel functions. Using LabVIEW 7.1 and Matlab R14 service pack 3.

    Labview 8.5
    Matlab R2009b
    Attached are the graphs produced by matlab script in labview and in matlab.
    The minimum of graph produced by matlab code is below 1 and that in labview is above 1.
    Thanks a lot for your reply.
    Sorry, I haven't quantified the "sometimes" yet. 
    Attachments:
    matlabsResult.jpg ‏29 KB
    LV.png ‏84 KB

  • Why not exists and minus give different result

    HI,
    I am writing thes query by using two different operators they should give me the same output but they dont. Please can anybody explain why they give different output.
    query 1
    SQL> SELECT COUNT(*) FROM
    2 (select orig_idx
    3 from rel15_au_poi a
    4 MINUS
    5 SELECT ORIG_IDX
    6 FROM REL14_1_AU_POI_INTERM B) ;
    COUNT(*)
    244312
    query 2
    SQL> select count(*)
    2 from rel15_au_poi a
    3 where not exists
    4 (select null from rel14_1_au_poi_interm b where a.orig_idx=b.ORIG_IDX) ;
    COUNT(*)
    245341
    best Regards,

    Because you have duplicates in rel15_au_poi which are counted with exists and removed with minus.
    http://download.oracle.com/docs/cd/B19306_01/server.102/b14200/queries004.htm#sthref3147
    MINUS Example
    The following statement combines results with the MINUS operator, which returns only unique rows returned by the first query but not by the second:
    SELECT product_id FROM inventories
    MINUS
    SELECT product_id FROM order_items;

  • Same C++ code gives different result in MacOSX and Ubuntu

    Hi
    I have a C++ program which starts by reading an external file, but changing the name of the file give me different results.
    I selected just the important part and made a simple file with the reading part of my program and can be downloaded here
    http://dl.dropbox.com/u/664351/files.zip
    It just reads the external file and does the output of some values.
    It has two external file examples. If one uses "x.txt" everything works fine, but if we use "dados.txt", which is a copy of "x.txt", the last value in the output is wrong.
    The stranger is that if i use these same files in ubuntu everything works just fine!
    I tried in a MacBook, a MacBook Pro and an iMac (all of them with macosx 10.6) and i always got the error, but not on ubuntu!
    Does anyone has a clue about what is happening here?
    Cheers,
    Marcelo

    marcelobarbosa wrote:
    Does anyone has a clue about what is happening here?
    Change OutFile from a 20 byte character array to a string. GCC isn't able to tell what type that is and is picking int or something, corrupting your memory.

  • 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

  • Matlab 'place' command gives different result in Mathscript/Labview

    Hello,
    I am trying to implement a order reduced observer in Labview. First I used Labview blocks for programming but it happens that I get different results when I am using Matlab. For that reason I used Mathscript to make a simple 'place' command to check it. The result in Labview and Mathscript is the same, but not in Matlab...
    This is the instruction in Matlab:
    A22=[0.9024 0 0;0 0.8607 0; 0 0 0];
    A12=[0 0 0 ;0 0 0.0548;0.0417 0 0;0 -0.0417 0];
    K=place(A22',A12',[0.32 0.31 0.3]);
    Ko=K'
    Ko =
             0         0   13.9664         0
             0         0         0  -13.2062
             0   -5.4745         0         0
    And I have attached the VI where I do the test with Labview blocks and Mathscript. As you can see the result is not even close to be similar. Why is this produced? How can I fix it?
    Thank you a lot in advance!
    Attachments:
    pruebararamathscript.vi ‏39 KB

    Hi,
    Indeed there are a lot of gains that places the poles on the desired locations. BUT, seeing as the Varga's SEAP algorithm is implemented, the G matrix is selected through a uniform white noise generator and the desired characteristics are verified (controllability). This does not unsure optimization regarding stability margins or disturbance rejection (sensitivity minimization regarding perturbations an matrix A or B).
    As an example, the system presented in this thread, the algorithm implemented in CD Pole Placement.vi computes an observer gain that determine a 7,4455 value for closed loop infinity norm. The place algorithm in Matlab computes an observer gain that determine a 2,8230 value for closed loop infinity norm, so better noise rejection or robustness.
    cosmin

  • Using default namespace with XMLNode.valueOf()

    XMLNode.valueOf(String, NSResolver) takes in a namespace resolver. Is it possible to specify a default namespace with the namespace resolver so that if the XSL Pattern is not qualified, e.g., "/myElt/bar", default namespace will be used?
    Thanks.
    - sam
    null

    XMLNode.valueOf(String, NSResolver) takes in a namespace resolver. Is it possible to specify a default namespace with the namespace resolver so that if the XSL Pattern is not qualified, e.g., "/myElt/bar", default namespace will be used?
    Thanks.
    - sam
    null

  • Disk Utility Gives Differing Results...........

    I used disk utility (Leopard, not from start up disk) to repair permissions and to verify the hard drive. Permissions repair worked fine (but v slowly), but verifying the disk brought up an error saying that the disk needed to be repaired. I therefore ran disk utility from the disk (ie holding c at startup etc....).
    Running disk utility eventually resulted in green text saying that no repair of the disk was necessary.
    I restarted, re-ran disk utility in Leopard and it still says the disk needs to be repaired. Onyx also says the disk needs to be repaired. I have run the extended hardware test, which said there are no problems.
    Can anyone shed any light on why I am getting these different results and if I need to be worried???
    Many thanks in advance!

    There are a few important points to verify to ensure an external drive is bootable. Attach the external drive while started up normally. Run Disk Utility. Select the external drive in the left sidebar and look at the info at the bottom of the window. To be able to install Leopard on it, the Partition Map Scheme must be GUID Partition Table.
    If it is GUID Partition Table, you can start up from the Mac OS X installation disk and select it as the target for installation. If the drive is not empty, the data already on it will not be affected, but you should probably back it up if it is valuable. After the installation, start up from the external drive and run Software Update to get all the updates. You will have to run Software Update a few times to get all the inter-dependent updates.
    If it is not GUID Partition Table, you will need to re-partition it and change it to GUID Partition Table using Disk Utility's Partition tab. In this case, the drive will be erased.
    Once you have done the installation and all the updates, you can run Disk Utility while started up from the external drive and select the internal drive for the Repair routine. Since the Repair process should be identical, hopefully the results will be consistent.

  • Calculation in owb gives different result vs db

    hello
    i have a case when calculation in expression in a mapping
    when i run the mapping the result of this expression is different from when i run it directly at the database level
    has anyone ever encountered a situation like this?
    i appreciate any tips
    rgds

    hello
    i found the cause of that;
    apparently the date format set at db level was dd-rrrr-yy, whereas when running the same expression via sqldeveloper i had the local setting for date :dd-mm-rrrr
    as such when the calculation was executied via OWB it used the defualt nls setting and resulted in incorrect outcome;
    rgds

  • Insert, select and create table as give different results

    Hi all
    I have a strange situation with this three cases:
    1) select statement: SELECT (...)
    2) insert statement with that same select as above: INSERT INTO SELECT (...)
    3) create table statement again with that same select: CREATE TABLE AS SELECT (...)
    Each of these cases produce different number of rows (first one 24, second 108 and third 58). What's more the data for second and third case doesn't have any sense with what they should return. The first case returns good results.
    One interesting thing is that select uses "UNION ALL" between 2 queries. When simple UNION is used, everything works fine and all three cases return 24 rows. Also if each query is run seaprately, they work fine.
    Anyone encountered something like this? (before i create an SR :)
    Database is 10.2.0.2 on AIX 5.3. It's a data warehouse.
    Edited by: dsmoljanovic on Dec 10, 2008 3:57 PM

    I understand UNION vs UNION ALL. But that doesn't change the fact that same SELECT should return same set of rows wether in INSERT, CREATE TABLE AS or a simple SELECT.
    DB version is 10.2.0.2.
    Here is the SQL:
    INSERT INTO TMP_TRADING_PROM_BM_OSTALO
    select
    5 AS VRSTA_PLANIRANJA_KLJUC, u1.UNOS_KLJUC, t1.TRADING_TIP_KLJUC, i1.IZVOR_KLJUC, m1.ITEMNAME AS MJESEC,
    l1.PLAN AS IZNOS, l1.TEKUA AS TEKUCA, l1.PROLA AS PROSLA, l1.PLANTEKUA_ AS IZNOS_TEKUCA, l1.PLANPROLA_ AS IZNOS_PROSLA, l1.TEKUAPROLA_ AS TEKUCA_PROSLA, l1.DATUM_UCITAVANJA
    from
    HR_SP_PLAN.L_12_ET_PROMETI_I_BRUTO_MARZA l1,
    select
    m1.ITEMIID, m1.ITEMNAME
    from
    HR_SP_PLAN.L_12_IT_4_MJESECI m1
    where
    UPPER (m1.ITEMNAME) NOT LIKE '%KVARTAL%' AND UPPER (m1.ITEMNAME) NOT LIKE '%GODINA%' AND UPPER (m1.ITEMNAME) NOT LIKE '%PROC%' and
    m1.DATUM_UCITAVANJA = to_date('24.11.2008','dd.mm.yyyy')
    union all
    select -99, null from dual
    ) m1,
    HR_SP_PLAN.L_12_IT_5_SEKTORI l2,
    HR_SP_PLAN.L_12_IT_2_TIPOVI_OSTALO l3, HR_SP_PLAN.D_UNOS u1, HR_SP_PLAN.D_TRADING_TIP t1, HR_SP_PLAN.L_12_IT_1_PROMET_I_BM_OSTALO p1, HR_SP_PLAN.D_IZVOR i1
    where
    l1.ELIST = l2.ITEMIID and
    l2.ITEMNAME = u1.UNOS_NAZIV and u1.USER_KLJUC = 12 and l2.DATUM_UCITAVANJA = to_date('24.11.2008','dd.mm.yyyy') and
    l1.DIMENSION_1_PROMET = p1.ITEMIID and
    p1.ITEMNAME = i1.IZVOR_NAZIV and i1.USER_KLJUC = 12 and p1.DATUM_UCITAVANJA = to_date('24.11.2008','dd.mm.yyyy') and
    nvl(l1.DIMENSION_4_MJESEC , -99) = m1.ITEMIID and
    l1.DIMENSION_2_TIPOVI = l3.ITEMIID and
    l3.ITEMNAME = t1.TRADING_TIP_NAZIV and l3.DATUM_UCITAVANJA = to_date('24.11.2008','dd.mm.yyyy') and
    l1.DATUM_UCITAVANJA = to_date('24.11.2008','dd.mm.yyyy') and
    'PROC' = 'PLAN'
    union all
    select
    4 AS VRSTA_PLANIRANJA_KLJUC, u1.UNOS_KLJUC, t1.TRADING_TIP_KLJUC, i1.IZVOR_KLJUC, m1.ITEMNAME AS MJESEC,
    l1.PROCJENA AS IZNOS, l1.TEKUA AS TEKUCA, l1.PROLA AS PROSLA, l1.PROCJENATEKUA_ AS IZNOS_TEKUCA, l1.PROCJENAPROLA_ AS IZNOS_PROSLA, l1.TEKUAPROLA_ AS TEKUCA_PROSLA, l1.DATUM_UCITAVANJA
    from
    HR_SP_PLAN.L_13_ET_PROMETI_I_BRUTO_MARZA l1,
    select
    m1.ITEMIID, m1.ITEMNAME
    from
    HR_SP_PLAN.L_13_IT_4_MJESECI m1
    where
    UPPER (m1.ITEMNAME) NOT LIKE '%KVARTAL%' AND UPPER (m1.ITEMNAME) NOT LIKE '%GODINA%' AND UPPER (m1.ITEMNAME) NOT LIKE '%PROC%' and
    nvl(ceil(to_number(m1.ITEMNAME)/3), mod(4, 5)) = mod(4, 5) and m1.DATUM_UCITAVANJA = to_date('24.11.2008','dd.mm.yyyy')
    union all
    select -99, null from dual
    ) m1,
    HR_SP_PLAN.L_13_IT_5_SEKTORI l2, HR_SP_PLAN.L_13_IT_2_TIPOVI_OSTALO l3,
    HR_SP_PLAN.D_UNOS u1, HR_SP_PLAN.D_TRADING_TIP t1,
    HR_SP_PLAN.L_13_IT_1_PROMET_I_BM_OSTALO p1, HR_SP_PLAN.D_IZVOR i1
    where
    l1.ELIST = l2.ITEMIID and
    l2.ITEMNAME = u1.UNOS_NAZIV and u1.USER_KLJUC = 13 and l2.DATUM_UCITAVANJA = to_date('24.11.2008','dd.mm.yyyy') and
    l1.DIMENSION_1_PROMET = p1.ITEMIID and
    p1.ITEMNAME = i1.IZVOR_NAZIV and i1.USER_KLJUC = 13 and p1.DATUM_UCITAVANJA = to_date('24.11.2008','dd.mm.yyyy') and
    nvl(l1.DIMENSION_4_MJESEC , -99) = m1.ITEMIID and
    l1.DIMENSION_2_TIPOVI = l3.ITEMIID and
    l3.ITEMNAME = t1.TRADING_TIP_NAZIV and l3.DATUM_UCITAVANJA = to_date('24.11.2008','dd.mm.yyyy') and
    l1.DATUM_UCITAVANJA = to_date('24.11.2008','dd.mm.yyyy') and
    'PROC' = 'PROC';

  • Smpatch analyze gives different result after disabling Sun Connection Host

    Hi all,
    after disabling the Sun Connection Hosted functionality due to the EOL announcement I get a smaller number of patches from 'smpatch analyze' for a brand new jumpstarted server (227 patches before vs. 106 patches after).
    Trying e.g. a individual analysis for 126651-01 (Synopsis: SunOS 5.10: tar patch) results in
    Error: One or more of the updates specified do not have entitlement permissions.
    BTW: I ran the analysis for patch 126651-01 before without any problem.
    The entitlement file
    /var/sadm/spool/cache/entitlement/https%3A%2F%2Fgetupdates1.sun.com%2F%2Fentitlement_client
    looks like
    ----START-ENTITLEMENT-TOKENS----
    Solaris10Security
    SolarisSecurityUpdates
    SolarisDataIntegrityUpdates
    SolarisHardwareUpdates
    SolarisUtilityUpdates
    Public
    -----END-ENTITLEMENT-TOKENS-----
    And we do have a service plan!
    Any ideas?
    Kind Regards
    Marco

    Hi Shen,
    thanks for your reply. I tried this procedure from your thread
    Try re-registering the patch server after running these commands:
    # cacaoadm stop
    # cacaoadm status
    # rm -r /var/sadm/spool/cache/*
    # /usr/lib/cc-ccr/bin/eraseCCRRepository
    # rm /var/scn/persistence/SCN*
    # cacaoadm start
    # /usr/sbin/sconadm register -a -r registrationprofile.properties
    But unfortunately the problem persists. The entitlement file looks the same as before. The registrationprofile.properties files looks like
    userName=<username>
    password=<pw>
    hostName=<hostname>
    subscriptionKey=<key>
    portalEnabled=false
    proxyHostName=
    proxyPort=
    proxyUserName=
    proxyPassword=
    We use a direct connection to sun's update server without a SunUC proxy. (I disabled the proxy, because I had some trouble with it in the past).
    'smpatch get' gives
    patchpro.backout.directory - ""
    patchpro.baseline.directory - /var/sadm/spool
    patchpro.download.directory - /var/sadm/spool
    patchpro.install.types - rebootafter:reconfigafter:standard
    patchpro.patch.source - https://getupdates1.sun.com/
    patchpro.patchset - current
    patchpro.proxy.host - ""
    patchpro.proxy.passwd **** ****
    patchpro.proxy.port - 8080
    patchpro.proxy.user - ""

Maybe you are looking for

  • What to do when I lost my iPod touch?

    What do I do when my daughter lost her iPod touch?

  • Very Fast Rendering to sudden Painful Crawl

    Both AE and AME updated to most recent CC 2014 versions ~ I've been attempting to render-out a 8-minute composition that starts to encode in Adobe Media Encoder at a gangbuster's pace, only to stop to an almost insta-crawl. 75% of the encoding in AME

  • Which option to upgrade before getting iMac?

    I am yet to purchase a new iMac from Apple. However, due to budget constraints, I have to choose between a 256GB SSD, a 1TB fusion drive and upgrading from a 2GB to a 4GB graphics card. I'll be doing a lot of video editing as well as the usual every

  • Component visibility in the screen,

    Hi I'm facing a problem in the visibility of the component. My need is to identify the component is in visibility or not. ex: In a panel, i'm trying to change the location of the label , at a stage the label gets moved to end and the label is not in

  • How to take data dump(export) with given language set on oracle 9i database(production server) ?

    Hi, I am taken data dump on oracle 9i machine and ported (imported ) oracle 10g (production machine) ,But it will showing error : language set error, Could you tell me how to take data dump with language set. Regards, Suva