XMLAgg alias: Inconsistent between 10g (10.2.0.4) and 11g (10.2.0.3)

Hi All,
We're seeing inconsistent behavior between 10g (10.2.0.4) and 11g (10.2.0.3) when aliasing a nested select statement that returns an XMLAgg.
Not sure if this is an instance of Oracle correcting behavior or if this should be considered a bug.
Sample query:
SELECT xmlelement("ItemData",
(SELECT xmlagg(
XMLELEMENT("Item", x.item)
FROM (SELECT 'item1' item FROM dual
UNION ALL
SELECT 'item2' item FROM dual) x
) AS "Items" -- in10g alias on nested select is used for grouping element name; however in 11g alias is ignored
).extract('/') xml
FROM dual;
10g result:
<ItemData>
<Items>
<Item>item1</Item>
<Item>item2</Item>
</Items>
</ItemData>
11g result:
<ItemData><Item>item1</Item><Item>item2</Item></ItemData>
The issue is the missing “Items” element, not the pretty print.
Alternate 1:
I’ve found that I can use SYS_XMLAGG together with XMLFormat so that it works in either 10g or 11g -- When using in 10g the nested select statement cannot be aliased otherwise a duplicate Items element is created
SELECT xmlelement("ItemData",
(SELECT sys_xmlagg(
XMLELEMENT("Item", x.item),
XMLFormat('Items')
FROM (SELECT 'item1' item FROM dual
UNION ALL
SELECT 'item2' item FROM dual) x
) -- Cannot alias in 10g otherwise a grouping element is created
).extract('/') xml
FROM dual;
10g result:
<ItemData>
<Items>
<Item>item1</Item>
<Item>item2</Item>
</Items>
</ItemData>
11g result:
<ItemData><Items>
<Item>item1</Item>
<Item>item2</Item>
</Items>
</ItemData>
Alternate 2:
Another alternative is using an additional XMLElement tag to create the grouping element “Items” (As above select statement w/ XMLAGG cannot be aliased)
SELECT xmlelement("ItemData",
xmlElement("Items",
(SELECT xmlagg(
XMLELEMENT("Item", x.item)
FROM (SELECT 'item1' item FROM dual
UNION ALL
SELECT 'item2' item FROM dual) x
)-- Cannot alias in 10g otherwise a grouping element is created
).extract('/') xml
FROM dual;
10g result:
<ItemData>
<Items>
<Item>item1</Item>
<Item>item2</Item>
</Items>
</ItemData>
11g result:
<ItemData><Items><Item>item1</Item><Item>item2</Item></Items></ItemData>

Hi,
This issue was discussed a couple of years ago : {thread:id=1093561}
IMO, the correct behaviour is the 11g's.
The Alternative #2 you mentioned above using XMLElement (or XMLForest) should be the only way to correctly deal with this situation in any version.
Just curious, where did you first see/learn that aliasing a subquery should create automatically an additional wrapping element?

Similar Messages

  • Inconsistency between catalog authoring tool & Search engine

    Hi,
    We are on CCM2.0 and SRM5.0 with catalog deployment in the same client as SRM.
    In our implementation we are using master catalog and product catalog. We have very recently deleted around 65 items from our product catalog which is mapped to mater catalog and hence those 65 items are not found anymore in master catalog in CAT (Catalog authoring tool).
    This master catalog when published, we expect that these 65 products should not be available for end users.
    But end users can still see the deleted items through CSE (Catalog search engine). Thus there is data inconsistency between CAT & CSE.
    Has anyone faced similar issue before if yes can you please share the same with us.
    Edited by: Manoj Surve on Mar 24, 2009 7:05 AM

    Run TCODE SE38 program /CCM/CLEANUP_MAPPING to look for errors/orphaned records in test mode.
    If you want to clear out orphaned records uncheck the Test Mode but:
    Warning: This program can slow down a production system as it clears out the memory buffers for user catalog searches and these have to be built up again by the users doing searches.  This can be  hours to days depending upon the size of your system and the number of users.
    In Dev or UAt no problem.
    Hope this helps?
    Regards
    Allen

  • Inconsistency between get-childitem -include and -exclude parameters

    Hi,
    Powershell 2.0
    Does anyone else consider this a minor design bug in the Get-ChildItem command?  
    # create dummy files
    "a","b","c" | % {$null | out-file "c:\temp\$_.txt"}
    # this "fails", returns nothing
    get-childitem c:\temp -include a*,b*
    # this "works", returns desired files
    get-childitem c:\temp\* -include a*,b*
    # this "works", excludes undesired files
    get-childitem c:\temp -exclude a*,b*
    # this "fails", excludes undesired files BUT RECURSES sub-directories
    get-childitem c:\temp\* -exclude a*,b*
    I'm writing a wrapper script around the GCI cmdlet, but the inconsistency between the two parameters is problematic.  My end user will surely just type a path for the path parameter, then wonder why -include returned nothing.  I can't unconditionally
    add an asterisk to the path parameter, since that messes up the exclude output.
    I'm just wondering why Microsoft didn't make the parameter interaction consistent???  
    # includes desired files in the specified path
    get-childitem -path c:\temp -include a*,b*
    # excludes undesired files in the specified path
    get-childitem -path c:\temp -exclude a*,b*
    # combine both options
    get-childitem -path c:\temp -include a*,b* -exclude *.log,*.tmp
    # same as above, the asterisk doesn't matter
    get-childitem -path c:\temp\* -include a*,b*
    get-childitem -path c:\temp\* -exclude a*,b*
    get-childitem -path c:\temp\* -include a*,b* -exclude *.log,*.tmp
    # same as above, but explicitly recurse if that's what you want
    get-childitem -path c:\temp\* -include a*,b* -recurse
    get-childitem -path c:\temp\* -exclude a*,b* -recurse
    get-childitem -path c:\temp\* -include a*,b* -exclude *.log,*tmp -recurse
    If I execute the "naked" get-childitem command, the asterisk doesn't matter...
    # same results
    get-childitem c:\temp
    get-chileitem c:\temp\*
    If this isn't considered a bug, can you explain why the inconsistency between the two parameters when combined with the -path parameter?
    Thanks,
    Scott

    The Get-ChildItem cmdlet syntax is horrific for advanced use. It's not a bug in the classic sense, so you shouldn't call it that. However, feel free to call it awful, ugly, disastrous, or any other deprecatory adjective you like - it really is
    nasty.
    Get-ChildItem's unusual behavior is rooted in one of the more 'intense' dialogues between developers and users in the beta period. Here's how I recall it working out; some details are a bit fuzzy for me at this point.
    Get-ChildItem's original design was as a tool for enumerating items in a namespace -
    similar to but not equivalent to dir and
    ls. The syntax and usage was going to conform to standard PowerShell (Monad at the time) guidelines.
    In a nutshell, what this means is that the Path parameter would have truly just meant Path - it would not have been usable as a combination path specification and result filter, which it is now. In other words
    (1) dir c:\temp
    means you wanted to return children of the container c:\temp
    (2) dir c:\temp\*
    means you wanted to return children of all containers inside
    c:\temp. With (2), you would never get c:\tmp\a.txt returned, since a.txt is not a container.
    There are reasons that this was a good idea. The parameter names and filtering behavior was consistent with the evolving PowerShell design standards, and best of all the tool would be straightforward to stub in for use by namespace
    providers consistently.
    However, this produced a lot of heated discussion. A rational, orthogonal tool would not allow the convenience we get with the dir command for doing things like this:
    (3) dir c:\tmp\a*.txt
    Possibly more important was the "crash" factor.  It's so instinctive for admins to do things like (3) that our fingers do the typing when we list directories, and the instant failure or worse, weird, dissonant output we would get with a more pure Path
    parameter is exactly like slamming into a brick wall.
    At this point, I get a little fuzzy about the details, but I believe the Get-ChildItem syntax was settled on as a compromise that wouldn't derail people expecting files when they do (3), but would still allow more complex use.  I think that this
    is done essentially by treating all files as though they are containers for themselves. This saves a lot of pain in basic use, but introduces other pain for advanced use.
    This may shed some light on why the tool is a bit twisted, but it doesn't do a lot to help with your particular wrapping problem. You'll almost certainly need to do some more complicated things in attempting to wrap up Get-ChildItem. Can you describe some
    details of what your intent is with the wrapper? What kind of searches by what kind of users, maybe? With those details, it's likely people can point out some specific approaches that can give more consistent results.

  • Inconsistency between tbtco and tbtcs

    Hello guys,
    we have a big problem after our HWU upgrade.
    We have copied the content of tbtco into a new table tbtco_copy before the upgrade to save all the job entries.
    After this we have deleted the contant of tbtco. So we had no scheduled jobs for the HWU
    After the HWU we have copied back the content of tbtco_copy into tbtco.
    But now we have a inconsistency between tbtco and tbtcs. This means that all planed and released jobs are not starting (delay goes up).
    How we can start this jobs << Removed >>
    Br
    Christian
    Edited by: Rob Burbank on Apr 19, 2009 4:23 PM

    USer TR: SM65

  • There is an inconsistency between the authentication mode of target web application and the source web application after migrating to claims

    I've had my farm upgraded from SP2010 to SP2013 for over 6 months now and all is well, however, I was refreshing my staging environment from production and I noticed that one of the databases still shows these errors when I run test-spcontentdatabase:
    Category             : Configuration
    Error             : False
    UpgradeBlocking : False
    Message           : The [SharePoint Web App] web application is configured with claims authentication mode however the content database you are trying to attach is intended to be used against
    a windows classic authentication mode.
    Remedy              : There is an inconsistency between the authentication mode of target web application and the source web application. Ensure that the authentication mode setting in upgraded web application is the
    same as what you had in previous SharePoint 2010 web application. Refer to the link "http://go.microsoft.com/fwlink/?LinkId=236865" for more information.
    This doesn't make sense considering I converted the production web application to claims during the upgrade and then verified all sites were working with claims logins. I also verified that existing AD user identities were converted to claims by checking out
    the database tables. Yet test-spcontentdatabase still thinks there is a mismatch here.
    My farm is SP1 and no further CUs. The point of this particular refresh is so I can update to the November CUs in my test farm. Anyone else see this? Seems like it's a bug/safe to ignore because my stuff is working.
    Thanks,
    Aaron

    See:
    http://thesharepointfarm.com/2014/11/test-spcontentdatabase-classic-to-claims-conversion/
    Trevor Seward
    Follow or contact me at...
    &nbsp&nbsp
    This post is my own opinion and does not necessarily reflect the opinion or view of Microsoft, its employees, or other MVPs.

  • Differences between Oracle Discoverer  10g and 11g .

    we would like to know if they are any differences between Oracle Discoverer 10g and 11g and any issues with 10g that are overcome in 11g.
    Please make us aware of any merits in going for 11g over 10g.
    apps version 11.5.10.2
    Regards

    Please see these links for the list of new features, bug fixes, certification, and installation of Discoverer 11g on 11i instance.
    Discoverer 11.1.1.4 Certified with E-Business Suite
    http://blogs.oracle.com/stevenChan/2011/02/discoverer_11114_ebs.html
    EBS Sysadmin Primer: Oracle BI Discoverer 11gR1
    http://blogs.oracle.com/stevenChan/2010/08/discoverer_11gr1_primer.html
    Oracle Business Intelligence Discoverer 11g
    http://www.oracle.com/technetwork/developer-tools/discoverer/overview/index.html
    Oracle Business Intelligence Discoverer 11g documentation
    http://www.oracle.com/technetwork/developer-tools/discoverer/documentation/index.html
    Thanks,
    Hussein

  • Important differences between oracle 10g and 11g

    Hi friends, can anyone tell me (pointwise) what are the major (and minor) differences between Oracle 10g and 11g.
    Please point me to some documents if possible.
    Thanks in advance

    The name of the link says it all: "top_features."
    In short it is Oracle's list of what they have for marketing and sales reasons designated "top features."
    It is not intended to be, and is not, a complete list of features. Often the features Oracle does not
    talk about are the most important.
    Let me give you some examples. I have never seen Oracle announce DBMS_XPLAN as a new feature
    yet you should not run an explain plan without it. Neither have I ever seen Oracle announce the new
    NO_DATA_NEEDED predefined exception. I have listed literally hundreds of new features you will not
    find in Oracle's new features docs.
    I did a presentation at OpenWorld this year as part of the unconference titled "New Features in
    Database 11gR2 that Oracle will not announce." It was easy to prepare a one hour presentation with
    little fear of being proved incorrect. As I turned out only one of the features I presented was mentioned
    by Oracle.
    You can find the presentation slides here:
    http://www.morganslibrary.org/pres/oow09_ucnf.pdf

  • Customise table inconsistency between ABAP Dictionary and the databas

    Hi all,
    I have encountered a problem where by, I was not able to activate a table due to inconsistency between ABAP Dictionary and the database.
    After I run the SE14--> Check Database object. It has show that there is a missing Unique Index(Primary Index) at the Database Level, but at ABAP Dictionary it is there.
    I have try to recreate the primary index at the Database level, but failed. Because one of the primary key field is been dropped from this table.
    So now, may I know how can I still make this table Active again?
    Is it save to folllow the following solution that I found on internet?
    Syntax error in SDCC, table inconsistency between ABAP Dictionary and the database, transport error 8 during the generation of ABAP Dictionary. When you call Transaction SDCC, a termination occurs due to a putative syntax error because a table is not known or active. When you check this with the ABAP dictionary (SE11), you notice, that the table is active or inactive, however it is not possible to activate it. The activation might terminate with the error message 'Inconsistency between ABAP Dictionary and database'. A check of the affected object also delivers this error.
    Solution
    Proceed as follows:
    Log on as user DDIC
    Call Transaction SE14
    Enter the affected table name and
    select EDIT
    In the following screen, choose Table -> Reconstruct
    Confirm the execution
    Call Transaction SE11
    Enter the affected table name
    Display
    Activate
    Thanks.
    CK

    I managed to solved this by
    Solution
    Proceed as follows:
    Log on as user DDIC
    Call Transaction SE14
    Enter the affected table name and
    select EDIT
    In the following screen, choose Table -> Reconstruct
    Confirm the execution
    Call Transaction SE11
    Enter the affected table name
    Display
    Activate
    Thanks.
    CK

  • Task Flow Transaction Handling Inconsistent between JDeveloper R1 & R2.

    We have a solution developed using Jdeveloper 11.1.2.1.0.
    To describe the use case I will use the HR schema.
    The user must be able to view Regions and navigate to Countries and Locations in a hierarchical way. At each level he must be allowed to view and maintain the detail of the current record at that level. The user must also be able to navigate directly to a level and perform a search to view the data and from there be allowed to to view and maintain the detail of the current record at that level.
    So I have created the following design to achieve this and take into consideration that I need to reuse my task flows that maintain the data.
    Business Services (Model Project)
    1. HierarchyAM, containing Read Only VO’s of the various levels nested by association/view link.
    2. Region + Countries + Locations
    3. Search#Level#AM, A separate AM for each level, containing the Read Only VO per level.
    4. Maintain#Level#AM, A Separate AM for each level, containing an updateable VO per level.
    UI (View Controller Project)
    I created the following BTF’s (To try and keep the post short as possible I will only provide detail for a single level to explain the issues)
    *1. HiererchyBTF*
    a.     Contains a fragment.
    b.     Added RegionHierarchyBtf, CountryHierarchyBTF, LocationHierarchyBTF to the above fragment as dynamic regions.
    c.     Task flow transaction <No Controller Transaction>, isolated.
    *2. RegionHierarchyBTF. (The same BTF’s are created for each level in the hierarchy)*
    a.     Contains a fragment.
    b.     Exposed HierarchyAM<RegionRoVO>
    c.     Task flow transaction <No Controller Transaction>, shared.
    d.     Includes a call to the EditRegionBTF.
    *3. SearchRegionBTF (The same BTF’s are created for each level in the hierarchy)*
    a.     Contains a fragment.
    b.     Exposed SearchRegionAM<RegionRoVO>
    c.     Task flow transaction <No Controller Transaction>, isolated.
    d.     Includes a call to the EditRegionBTF.
    *4. EditRegionBTF*
    a.     Contains a fragment.
    b.     Exposed MaintainRegionAM<RegionVO>
    c.     Task flow transaction <Use Existing Transaction if Possible>, isolated.
    Runtime behaviour with above configuration.
    1.     Running the HiererchyBTF and navigation the levels works in all versions.
    2.     Calling an edit BTF allows me to edit the current record and successfully commit the data in all versions.
    3.     Calling an edit BTF for the same record immediately thereafter, allows me to edit the record and commit the data successfully in all versions.
    4.     Running any of search BTF’s and calling the edit BTF works in all versions.
    Runtime behaviour and changing the EditRegionBTF task flow transaction to Shared.
    1.     Running the HiererchyBTF and navigation the levels works in all versions.
    2.     Calling an edit BTF allows me to edit the current record in the table and successfully commit the data in all versions.
    3.     Calling an edit BTF for the same record immediately thereafter, allows me to edit the record and commit the data successfully in 11.1.1.4.0 & 11.1.1.6.0 only. If I perform the same scenario in 11.1.2.1.0 I receive the following exception.
    a.     JBO-25003: Object MaintainLocationAM of type ApplicationModule is not found.
    4.     Repeating the process, but after editing the first record, edit the second record in the table the error is not encountered. If, after successfully editing the second record and committing the data successfully, I again edit the first record I edited, I receive the same exception as in point 3.
    5.     Running any of search BTF’s and calling the edit BTF works in all versions.
    For the purpose of having a reusable edit task flow, I need to have the task flow transaction configuration as <Use Existing Transaction if Possible>, shared. This enables me to have the edit task flow as a parent as well as a child task flow and use the task flow functionality irrespective if it is controlling the transaction or not.
    My questions are;
    1. Is my design acceptable for the solution I am developing, I am more specifically questioning my separation of the AM’s to achieve loosely coupled task flows.
    2. Is there a bug (I have done a search on MOS) that details this behaviour.
    3. As, in my opinion, this is a common requirement, why is there inconsistency between the versions.
    The demo for each version can be made available.
    Regards.
    Leon.
    Edited by: Leon Dorfling on Feb 21, 2013 1:44 AM

    Hi Frank,
    +1. Its the first sting I stumbled on reading your post. Unless the read-only view object AMs are shared across users (application scope) I don't see why you want to have them in a separate AM. I don't see a benefit in a purely read-only view object that is not backed up by entities and thus would follow Oracle's recommendation to always use entities with view objects.+
    The read-only vo's are based on eo's. I separated the AM as the search use cases are independent of one another. So my understanding, from a performance perspective, is to not have all the read-only vo's of the entire hierarchy of products in a single AM if I am only going to access one of them. If I do not understand correctly, can you please assist me in better understanding.
    +2. For sure this behavior doesn't sound right and should be filed. You may want to check 11.2.3 in case it has been fixed in there already.+
    As posted by Chris, I have through MOS found that it has been fixed in a later version.
    Btw.: "Calling an edit BTF for the same record immediately thereafter, allows me to edit the record and commit the data successfully" how do you call this task flow dynamic region or task flow call activity ?
    The BTF's are called using a backing bean.
    Regards
    Leon.

  • Inconsistency between Condition Base Value in Rebate Monitor / Semi .....

    Hi All,
    there  is a big problem in Inconsistency between Condition Base Value in Rebate Monitor / Semi Automatic Bypass / MIS.
    We have discovered issues with inconsistent figures.
    Condition Base Value Rebate Monitor until Feb 29th is not equal with value from Semi Automatic Bypass with Settle to date Feb 29th
    - first analysis indicates, that Semi Automatic Bypass is taking 3 Billing documents into account which have Service Rendered Date March 3rd , but Billing Date Feb 29th:
    THE Rebates Monitor and Semi Automatic Bypass figures are always provided based on Requested Delivery Date/Service Rendered Date (and not based on Billing Date) and to ensure, that figures are always consistent.
    How to  fix it?
    Thanks in advance and regards
    William

    Hi,
    USE FMs SD_BONUS_READ and SD_BONUS_STAT_TARGET to fetch the values.
    Babul.

  • Difference between Materialised view in 10g and 11g

    Hi,
    I am beginner . I want to know the difference between Materialized view between 10g and 11g. Is there any impact if the materialized view used in 10g gets upgraded to 11g ?
    awaiting ur response.Please and Thanks

    In addition to the documentation, you might want to look at the blog of Alberto Dell'Era:
    http://www.adellera.it/blog/
    Alberto writes quite a bit about materialized views, including this important change in 11GR2:
    http://www.adellera.it/blog/2009/11/03/11gr2-materialized-view-logs-changes/

  • Difference between oracle bpm 10g and 11g

    Newbie: I am trying to understand 10g. The basic questions I have is
    1)What is the difference between 10g and 11g?
    2)What is the infrastructure & skillset needed for me to do implementation in 10g?
    3)How is migration from 10g to 11g is accomplished?
    Any resource links that would help me to get started with 10g would be appreciated.
    Chaitanya

    Hi,
    Please follow the below mentioned link to find your answer.
    Re: Main differences between oracle bpm 10.3 vs 11g
    Migration from ALBPM 5.7 to BPM 11g
    Bibhu

  • Diff between oracle 10g and 11g

    Can any one could tell me what is the main diff between oracle 10g and 11g ?
    Thanks in Advance
    Venkat

    Hi,
    You can read
    http://www.oracle.com/technetwork/articles/sql/index-082320.html
    http://www.oracle.com/technetwork/articles/sql/index-099021.html
    Anand

  • Diffrence between OBIEE 10g and 11g Architecture

    Hi
    Please help me by providing either the differences between the OBIEE 10g and 11g Architecture or a pointer/link.
    Thanks

    Hi,
    There are some!!
    Check here;
    http://www.rittmanmead.com/obiee11g/
    http://www.biconsultinggroup.com/images/VideoAlbum/WhitePapersFAQ10-31-10.pdf
    http://blogs.oracle.com/robreynolds/2010/12/security_in_obiee_11g_part_1.html
    http://blogs.oracle.com/robreynolds/2010/12/security_in_obiee_11g_part_2.html
    This will give an indication of all the changes.
    Cheers,
    Daan Bakboord
    http://obibb.wordpress.com

  • How to join three tables and practical difference between 10g and 11g

    I want to know with example how to outer join three different tables in Oracle.
    Also if you have any website or reference for understand syntax or performance difference between 10g and 11g then please paste a link in.thanks!!

    Hi,
    897293 wrote:
    I want to know with example how to outer join three different tables in Oracle.The 3rd table comes into the result set the same way the 2nd one did:
    FROM           table_1  t1
    LEFT OUTER JOIN      table_2  t2  ON   ...
    LEFT OUTER JOIN      table_3  t3  ON   ...The join condition(s) for t3 can reference t1, or t2, or both.
    Also if you have any website or reference for understand syntax or performance difference between 10g and 11g then please paste a link in.thanks!!The main manuals all have "What's New" sections near the beginning. For example:
    http://download.oracle.com/docs/cd/B28359_01/server.111/b28286/wnsql.htm#sthref5
    Hoek,
    We've missed you. Welcome back!

Maybe you are looking for

  • Problem running Oracle Portal to Go (Oracle9i 1.0.2.0.0)

    I have installed Oracle9i Application Server WE 1.0.2.0.0 Standard Edition on Windows2000 Professional Edition. I am getting problems regarding running Portal to Go. The installer said that installation was successful. Moreover I have done the config

  • Configuration - Item Category - How do I change the imcompletion procedure?

    For an existing Sales Item Category, I want to change from one incompletion procedure to another existing incompletion procedure.  However the field is greyed out in SPRO.  How do I change this setting?

  • Please Wait While Windows Configures Trusted Drive Manager

    Sometimes when I get an email with an attachment and try to open it I get a message that says "Please wait while Windows configures Trusted Drive Manager". It is annoying to see this and I'm not sure how to get rid of the message. Thank you for your

  • Should i use nested SQL Statements? or PL/SQL?

    here is my table: let's call this table total_stats, with 2 fields (columns) Date and Total. Row | Total ROW1 | 12508 ROW2 | 12526 I am going crazy trying to write some sql or pl/sql that will give me the following results: the result of row2Total -

  • How to Manage Archive Files in Oracle 10g

    Dear all I have 10g Database server running in Archive Mode, there are huge number of archive files have been increased , (1) how can i find old and obsoleted Archive files that will not be needed for recovery in future.so that i can delete them inor