Problems with DBMS_XMLGEN.getXML add features

Hello

I use DBMS_XMLGEN on 11 GR 2.

The documentation Pages of PL/SQL and Types Reference 11 GR 2 (July 2013) reads as follows:

GETXML functions

This function returns the XML document. The function is overloaded.

Syntax

Gets the XML document from the maximum number of rows specified. It

adds the XML in the CLOB passed Use this version of GETXML

To avoid extra CLOB copies and reuse the same CLOB for subsequent functions

calls. Due to the CLOB reuse, this GETXML Functionscall is potentially more

effective:

DBMS_XMLGEN. GETXML)

CTX IN ctxHandle,

tmpclob IN OUT NCOPY CLOB,

dtdOrSchema in numbers: = NONE)

RETURN A BOOLEAN VALUE;

11 GR 2 Guide (February 2014) developer Oracle DB XML stipulates the following:
Parameters

getXML (ctx IN ctxHandle,

clobval IN OUT NCOPY clob,

dtdOrSchema in numbers: = NONE);

CTX -The context handle from call

newContext.

clobval (IN/OUT) - the CLOB to which the XML document is

being attached,

dtdOrSchema -If you need to generate the DTD or

Schema. This parameter is NOT supported.

Use this version of the function getXML, in order to avoid any supplement

CLOB copies and if you want to reuse the same CLOB for

subsequent calls. This getXML call is more effective than the other

flavor, even if it means that you create the LOB reference.

When you generate the XML, the number of lines specified by the

setSkipRows call are ignored, then the maximum number of

ranks as specified by the setMaxRows call (or all if

not specified) is read and converted into XML. Use of the

getNumRowsProce

I'm bringing 2 parts of XML document.  I use 2 hierarchical queries.  One to generate hierarchical header of a table and another information to generate information of hierarchical detail to a separate table. My code is generally as follows:

DECLARE

hdrctx DBMS_XMLGEN.ctxHandle;

detailctx DBMS_XMLGEN.ctxHandle;

hdrdoc CLOB.

BOOLEAN success;

hdrqry VARCHAR2 (2000): = ' SELECT LEVEL, XMLELEMENT (EVALNAME HTAGNAME, HTAGVAL) OF HDRTABLE

CONNECT HSUBSEQ = PRIOR HGRPSEQ';

--

detailqry VARCHAR2 (2000): = ' SELECT LEVEL, XMLELEMENT (EVALNAME DTAGNAME, DTAGVAL) OF DETAILTABLE

CONNECT DSUBSEQ = PRIOR DGRPSEQ';

BEGIN

hdrctx: = DBMS_XMLGEN.newContextFromHierarchy (hdrqry);

detailctx: = DBMS_XMLGEN.newContextFromHierarchy (detailqry);

DBMS_LOB.CREATETEMPORARY (hdrdoc, true);

DBMS_XMLGEN. GetXml (hdrctx, hdrdoc);

-dbms_output.put_line (hdrdoc);

DBMS_XMLGEN. GetXml (detailctx, hdrdoc);

DBMS_XMLGEN.closeContext (hdrctx);

DBMS_XMLGEN.closeContext (detailctx);

dbms_output.put_line (hdrdoc);

DBMS_LOB. FREETEMPORARY (hdrdoc);

END;

I also tried the next iteration:

BEGIN

hdrctx: = DBMS_XMLGEN.newContextFromHierarchy (hdrqry);

detailctx: = DBMS_XMLGEN.newContextFromHierarchy (detailqry);

DBMS_LOB.CREATETEMPORARY (hdrdoc, true);

hdrdoc: = DBMS_XMLGEN.getXML (hdrctx);

-dbms_output.put_line (hdrdoc);

DBMS_XMLGEN. GetXml (detailctx, hdrdoc);

DBMS_XMLGEN.closeContext (hdrctx);

DBMS_XMLGEN.closeContext (detailctx);

dbms_output.put_line (hdrdoc);

DBMS_LOB. FREETEMPORARY (hdrdoc);

END;

The two sources of documentation indicates that version 3 of overload of getXML parameter adds the CLOB parameter that is passed and yet I am not able to get the details to add to the header.  If I Uncomment the first put_line I get a document of xml output containing the header as expected information.  However, the second put_line outputs of an xml document that contains only the detail information and none of the header information.  It is not adding as stated in the documentation, but substitute instead.  Any ideas what is happening here and how I can get the feature of adding such as specified in the documentation?

An additional but trivial problem is the difference in the documentation.  Documentation packages and types indicates that 3 parameter getXML overload returns a BOOLEAN value.  DB XML Dev Guide does not indicate this.  When I use this, the call works as a process and not a function, but I'm failed in the 3rd parameter, which must by default to NONE.  I want to just make sure that using the 2 explicit and implicit parameters 1 is not ending up with me call the wrong version.

Thanks in advance for any help you can give me on this point,

Paul

Because that the additional XML prologue is a specific, defined in section it is easy to remove.

The best way to get something is to not generate it.

This is the meeting of the 2 segments arbitrarily dimensions and structured it's much more embarrassing for me.

What you mean?

I'll look into the possibility of restructuring in those non-hierarchical hierarchical queries as a work-around.

Don't bother it.

Simply add two structures manually instead of using a 'function' who obviously don't get you any advantage.

for example

DECLARE

hdrctx DBMS_XMLGEN.ctxHandle;

detailctx DBMS_XMLGEN.ctxHandle;

doc CLOB.

hdrqry VARCHAR2 (2000): = ' SELECT LEVEL, XMLELEMENT ("emp", xmlattributes (empno as "id")) FROM scott.emp

CONNECT BY prior empno = mgr

Start with mgr is null';

detailqry VARCHAR2 (2000): = ' SELECT LEVEL, XMLELEMENT ("emp2", xmlattributes (empno as "id")) FROM scott.emp

CONNECT BY prior empno = mgr

Start with mgr is null';

BEGIN

hdrctx: = dbms_xmlgen.newContextFromHierarchy (hdrqry);

detailctx: = dbms_xmlgen.newContextFromHierarchy (detailqry);

DBMS_LOB.CREATETEMPORARY (doc, true);

Select xmlserialize (document

XmlElement ("root"

dbms_xmlgen.getxmltype (hdrctx)

dbms_xmlgen.getxmltype (detailctx)

)

as clob dash

)

in the doc

Double;

dbms_xmlgen.closeContext (hdrctx);

dbms_xmlgen.closeContext (detailctx);

dbms_output.put_line (doc);

DBMS_LOB.freeTemporary (doc);

END;

/

output:


  
    
      
        
      
    
    
      
      
      
      
      
    
    
      
    
  
  
    
      
        
      
    
    
      
      
      
      
      
    
    
      
    
  

Tags: Database

Similar Questions

  • Problem with pop up adds and virus warnings when using safari

    I have an iMac with OS version 10.11.4 2011 mid.  Sites that I visit such as Ancestry.com, Google Maps and find A Grave.com, download pop up ads and new tabs open with warnings of virus heading towards various support sites, including those who say that Apple in charge.  The pop up and new tabs who may or may not happen if often the Web sites are very slow to respond at all to give me the turning ball.

    I closed several times tried to solve the problem in closing Safari, turn off my Wifi, then restart safari while pressing the SHIFT key, and then once that Safari has loaded, removing all data from the website and checking my making sure that my security settings is set to block pop-up windows up , and that my privacy is set to allow cookies and data Web site only on Web sites that I visit. Once I did this I activate Wifi.  But it does not clear the problem. I also ran Clamxav with the latest virus definitions that found six files with extensions of .emix that have been found in my emails and phishing files.

    I switched to Firefox as my default browser and have so far not had a problem with the pop adds up or virus alerts.  And the Web sites I visit have been working properly.

    What should I do to clear the problems I am having with Safari?

    August 2015 topic adware detection and removal - https://discussions.apple.com/thread/7184089

    Suggestions September 2015 by stedman1 - https://discussions.apple.com/message/28945970#28945970

    Download and use MalwareBytes

  • Problems with PerfMon - cannot add counters

    Hello everyone.  I registered just to ask this question, which I couldn't find after a long time consult Google.  I come to you in the hope that when Google has failed, you will not!

    I use a program that some of you may be familiar, called Samurize (http://www.samurize.com/modules/news/), who does a lot of things; what I use for most allowed, in a blink of an eye, discern my CPU usage, RAM usage, information network, availability, hard disk space and my schedule on the calendar, among other things.  I know it is an old program and I know that it was designed for Windows 2000/XP, but it worked without a hitch (not including this one) on Vista and Windows 7.

    Recently, however, the ability to monitor CPU, RAM, upload and speed of download and availability has disappeared; all of them give me a flatline, statement I use no internet at all or my computer also (with the exception of availability, which reports that I have been on my computer for 49 days, 17 hours, 2 minutes and 47 seconds... he refuses to go to the top!).  Initially I thought it was a problem with the program.  It is not; It has something to do with Perfmon.  When I load perfmon.exe through the box run, it loads up with an error that says:

    "Cannot add these counters:

    \Memory\Available MB
    \Memory\% committed bytes used
    Defects of \Memory\Cache/s
    Defects of \Memory\Cache/s
    Time to \%Idle \PhysicalDisk (*)
    \PhysicalDisk (*) \Avg disk queue length
    \Network interface (*) \Bytes Total/sec.

    This isn't me accidentally say the same thing twice... it says what I typed on verbatim. [Edit:] Just remembered: other system monitors are perfectly fine.  Of course the Task Manager works well, but gadgets seem to work fine in my use of RAM and CPU, as well as my download balance sheet and download speeds. [/ Edit]

    It's pretty much the sum of my progress on the problem.  I found this page (http://support.microsoft.com/default.aspx/kb/300956), which seems like it might solve the problem... but being a lazy man boned, I hope that there is a simpler solution than that, those who are not "reformat".

    Any other relevant information:

    Windows 7 x 64 professional
    Updated with all official updates
    Recently spent Wi - Fi cable (apart from that, I can't thing of any change that I did with my computer)

    Thanks in advance!

    Hello SensaiOpti,

    I had the same problem. A level that your pointers to the perfmon counters are damaged, you must re-create these with LODCTR from an elevated command prompt:

    Click Start, type cmd click right cmd.exeand select run as administrator.
    At the prompt, type lodctr /r and press ENTER. This allows to repair the pointers (those that are stored in the registry).


    C:\Windows\System32>lodctr/r

    Info: Rebuilt successfully setting from system backup store performance counter

    After this action, it is possible that some providers are disabled. You can check the status with lodctr/q.

    C:\Windows\System32>lodctr/q
    Performance counter ID queries [PERFLIB]:
    Based index: 0 x 00000737 (1847)
    Last counter text ID: 0 x 00001560 (5472)
    Last help text ID: 0 x 00001561 (5473)

    [.NET CLR data] Performance counters (activated)
    DLL name: netfxperf.dll
    Open the procedure: OpenPerformanceData
    Collect the procedure: CollectPerformanceData
    Close the procedure: ClosePerformanceData
    First counter ID: 0 x 00001080 (4224)
    Last counter ID: 0x0000108C (4236)
    First help ID: 0 x 00001081 (4225)
    Last help ID: 0x0000108D (4237)

    etc.

    If she says (disabled) next to a provider, you can activate it with lodctr/e:. Use for the string between the [] at the beginning of the entry.

    Success

  • Problems with disabling high-contrast feature in Windows 7/Toshiba laptop

    Remember - this is a public forum so never post private information such as numbers of mail or telephone!

    Ideas: good morning well you have heard of the saying if it's not broken don't change it... I tried to make a slight change to my screen, seen this Hi-contrast feature (ease of control panel access.. withun allowed him now, I can't do my original screensaver, my own image gone... and when I try changing the screen saver it is locked on the color tab... to REET will change not how to clear)

    • You have problems with programs
    • Error messages
    • Recent changes to your computer
    • What you have already tried to solve the problem

    What happens when you press

    ALT + left SHIFT + PrntScrn

  • I have problems with the Windows Update feature!

    I have problems with the function of update windows for KB2596598, KB2596744, KB2687310, KB2596786 with an error code of 80070641.  They keep for lack of update!  My current windows is Vista Home Premium! Do you have a solution for this?

    If System Mechanic is or has been installed, it is your troublemaker & you have lots of company!

    See my colleague Maurice RESPONSE message in this thread: http://answers.microsoft.com/thread/d6fedf33-dc1b-451f-9aab-97429f916180

    If still no joy, contact System Mechanic (iolo.com) supported for assistance-, they are well aware of the problem application has caused!

    TIP: If you think that more never your registry database needs to be cleaned, repaired, boosted, to the point, healed, twisted, fixed, magnified, "swept" or optimized (and even more to convince that it is not), read http://aumha.net/viewtopic.php?t=28099 and draw your own conclusions. See also http://blogs.technet.com/markrussinovich/archive/2005/10/02/registry-junk-a-windows-fact-of-life.aspx

  • Problem with the Excel add-in-TDM

    Hi-

    I used the ExcelTDM snap-in on other machines w / no problem, but I tried downloading it on a new computer (w / office 2003, Vista) & the icons do not appear in excel.

    I tried to follow the instructions on this page: http://zone.ni.com/devzone/cda/tut/p/id/5874

    I am stuck at step #3 b/c the ExcelTDM.dll file isn't the case on the computer.  Is it possible that the add-in is not download correctly?  I tried uninstalling and reinstalling the add-in twice now, with the same results.

    Any halp would be appreciated!  Thank you!!!

    Erin

    Hi ErinH,

    We want to confirm that you get the latest installer from the web download of the first http://zone.ni.com/devzone/cda/epd/p/id/2944 .

    Then, you will notice at the bottom of the download page there is a trick:

    After installing the TDM Excel Add-In in Microsoft Vista , you need start Microsoft Excel at least once by using administrator privileges.

    So if you use the Add-In in Vista, you can disable the UAC (User Account Control), or right-click on Excel.exe and "run as Administrator" for the first time.

    Good luck!

  • Problems with MAC WET11 cloning features

    Hello

    I'm having a devil of a time to set up my v2 WET11 to allow my XBOX be fully connected. I can configure and connect the bridge, ping, ftp files to XBOX etc. Only problem is when I try to play bound. I can see the game in progress on the second XBOX but cannot participate. Related game works perfectly when Xbox is wired to the router.  I know that play bound depends on each game console broadcasting their MAC, so I need to clone the MAC address of the XBOX to use the bridge.

    Unfortunately the WET11 web configuration interface I cannot do. Under Settings/Advanced cloning Mode, all controls are disabled - greyed. This includes the control that allows you to turn on cloning.  I took a shot the script behind the page and it seems that it checks to see if 'disable cloning' is selected and if so, disables all controls of cloning, including one that would allow me to get back on. Since the default value is disabled, it is the programmatic equivalent to lock the keys in the car. You can take a look at here emulated interface:

    http://UI.Linksys.com/files/WET11/v2/advanced.html

    Of course, the demo is fully functional and do not exhibit the problem...

    Many people have described solve their XBOX related play questions by cloning the MAC address of the XBOX and see change settings using the web interface.

    I tried different versions of the firmware 2.06 and 2.07, 2.08 USA 2.08 EU. Same results. Tried the Installer Wizard 1.06 worm, but he does not even include the MAC settings.

    Had two cats different with online support agents and the two seem as puzzled as I am.

    Am I missing something obvious? Depends on the availability of cloning parameters options elsewhere in the config utility?  Is the interface designed for cloning taking place without intervention of the user on the v2 and v1? (doubt)

    Has anyone else seen elsewhere?

    I know that people have written code to pull the strings of parameters off the unit then maybe the reverse is true and I can write the script to directly change the settings.

    Any suggestion would be appreciated.

    Rick

    Well well well - apparently the firmware is not totally compatible with IE7. Downloaded Firefox and the interface works as advertised.

    Rick

  • Problem with Windows Explorer add folders

    Lately when I get my Windows 7 Explorer, I can use is no longer the buttor add a folder to add folers to my libraries, how can I fix?

    1. What happens when you try?
    2. You can add folders elsewhere?
    3. Can you right click on an empty spot and select new | Folder?
     
  • CAVEAT! Problems with Firefox 29 Add-on of FEBE recheck your settings

    I discovered that my settings were changed.

    I found other modules where the settings have been changed / reset.

  • Have a problem with the Remote Desktop feature

    I'm doing my accessible remote desktop but the only option I have the 'rare' tab in the property window system is 'Remote Assistance '. All online guides show three remote desktop options which I don't have. How can I fix?

    Running Vista btw *.

    Hello Hallenhero,

    ·         What do Windows Vista version that you have installed on your computer?

    You can not use Remote Desktop connection to connect to computers running Windows Vista Starter, Windows Vista Home Basic, Windows Vista Home Basic N or Windows Vista Edition Home Premium. You can, however, connect to these editions of Windows Vista on computers running other versions of Windows.

    As a result, remote desktop is not available on these versions of Windows. You can see the bottom of the article for more information on this:

    http://Windows.Microsoft.com/en-us/Windows-Vista/connect-to-another-computer-using-Remote-Desktop-connection

    Thank you
    Irfan H, Engineer Support Microsoft Answers. Visit our Microsoft answers feedback Forum and let us know what you think.

  • problems with add-in "Acrobat" in Word and Excel (Office 365)

    Hello. I have problems with the 'Adobe' add-in in Word and Excel in Office 365. I have the paid version of Acrobat DC but looks like an incompatibility between the two programs for the add-in. However, it works very well in PowerPoint and Outlook. I have already received from Microsoft support, but they could not solve. Thank you.

    Hi claudia stellab63042214,.

    It is a known problem and our team is working to resolve.

    Please see this KB doc: https://helpx.adobe.com/acrobat/kb/PDFMaker-crashes-office2016-office365.html

    Kind regards

    Meenakshi

  • Problems with the conversion of Word files to PDF via macro

    I have a weird problem with the Acrobat add-in. I want to convert a lot of files with the Word Add-In in PDF files. The printer is no option because it causes other problems.

    So I created a small macro for Word that transforms all the Word of a directory of files PDF files. The macro works great, but PDF files look right.

    I show you the problem with a Word file, first converted manually, then with the macro:

    First of all the image:  If the file is converted manually, it seems that the Word file and fonts are included.

    convertedManually.png

    Second picture: If the macro converts the file it doesn't seem correct and the fonts are usually not included.

    convertedWithMacro.png

    I use Acrobat XI and Word 2010. The macro command is:

    ' new name for PDF
    pdfName = Replace(Replace(verz & "\" & fi.Name, "docx", "pdf"), "doc", "pdf")
                ' convert Word into PDF
                ActiveDocument.ExportAsFixedFormat OutputFileName:= _
                    pdfName, ExportFormat:= _
                    wdExportFormatPDF, OpenAfterExport:=False, OptimizeFor:= _
                    wdExportOptimizeForPrint, Range:=wdExportAllDocument, From:=1, To:=1, _
                    Item:=wdExportDocumentContent, IncludeDocProps:=False, KeepIRM:=False, _
                    CreateBookmarks:=wdExportCreateHeadingBookmarks, DocStructureTags:=True, _
                    BitmapMissingFonts:=False, UseISO19005_1:=False
    

    I did not, but the trick is to realize you don't want specific action. Rather, you want to treat a directory. DOCX files in the directory will be converted to PDF, then actions (if any).

  • Problem with 'Add a new value' component functionality

    Hi all

    I'm having a problem with the component feature 'add a new value '.  The component is designed to add an instructor for the purposes of accreditation.  When a new teacher is added using the component, it is added to a table for certification.  The search folder search this table allowing the user to update an existing record of instructor. Add the search folder for the component is a view of PS_PERSONAL_VW, which excludes the entries in the table of accreditation.  The only key to scroll 0 is emplid accreditation file. When an attempt is made to add a new employee, I get the error - "the value that you have tried to add already exists. Please specify a new value in the above fields. ", despite the fact that the selected employee was not added and is not in the table of accreditation.

    Someone has an idea of what the problem is here?

    PTools Version: 8.53.08

    PS App Version: 9.0

    Oracle DB Version: 11.2.0.3

    Version of the operating system: Win7 64 bit

    Thanks in advance.

    Too bad! I thought about it. It was a problem with the quick table of the emplid field.

  • I had a problem with slow, so I used "reset". The popup ran forever so I stopped it. Now I can not remove or add the program.

    I had a problem with slow, so I used "reset". The popup ran forever so I stopped it. Now I can not use, remove or add the program. How should I proceed?

    TIA,
    BWSwede

    Try to create a new profile.

    See "create a profile":

    If the new profile works then you can transfer files from a profile in the new profile, but make sure not to copy corrupted files.

    What problems do you have that you want to reset Firefox?

    Firefox creates a new folder of old data of Firefox on the desktop?

    If reset you Firefox and a new profile is created and some of your data (bookmarks, passwords, cookies, form data) is automatically imported and your current profile will be moved on the desktop (old data of Firefox).

  • Control ActiveX Mozilla & Plug in causes of support 1.0.0.4 my XP machine to get slow way. Is there a problem with it? I had to disable the Add On.

    With this active Add On, the system seems to be cycling in and out of repeated calls to "verify" something, I guess, adding an irritating delay for surfing the internet. I've seen no detrimental effect to the deactivation of this Add On to this day. It happens on some sites worse than others, but most is affected.

    Plug th Mozilla ActiveX Control is causing problems, and Mozilla have taken steps to block. Over the next few days a blocklist update should automatically be downloaded, which will result in this plugin automatically blocked.

Maybe you are looking for

  • HTC phone window 7.5 radar

    I have the HTC radar c110e with WP 7.5and I would like to re - download Skype for my phone. However, currently, it has no solution for HTC get this app on Windows Phone Marketplace.If there is any other way to get Skype back, please tell me how.

  • Satellite A30 PSA30E cannot start properly - PXE - E61: Media Test Failure

    Hope someone can point me in the right direction.I decided to use the recovery cd to format my laptop and do a clean install, because it became very slow.It takes an age to start etc. I followed the instructions on the leaflet that was packaged with

  • Exclude an iteration

    Hello. I must exclude a value of a forloop, and I did not how to... I made an example of what I want to do on the vi that I join Explanation: When the iteration 5 appears, we go straight to the value 6 without taking care of what we are supposed to d

  • Windows Media Player, CD burning

    I have burned over 100 old vinal records on CD using Windows Media Player, and EZ Converter Viñal now something has happened to the Media Player, it does not burn. I uninstalled and reinstalled nothing doesn't. I can't have the right panels onto the

  • How can I fix C:\windows\system32\newdev.dll - an application not valid win 32?

    The laptop seems to slow down for analysis from the window of newdev.dll skipped upward.