How to read labels and labels in a file XML in SQL and PL/SQL?

I have a few steps in Oracle to select the contents of an xml file, which works very well if all the labels and tags in the xml file is what I want.
My problem is that sometimes someone will change tags in an xml file and not tell me. If it happened, my select statement
does not return an error. If the XMLTABLE ('/ tblCageDuns/CageDuns ' part does not match the xml file (ex: instead of CageDuns, the xml file can))
have CageDun), I get no return lines. If one of the 'columns' does not match (ex: instead of "cage" the xml file can have "cages"), I get a null value
the value of the column. Is there a way to read what all the labels and the labels are in the xml file, so I can check them before I try to query the data?

Here are my basic steps:

1 create a table with an XML column:

create table cagexml_col)
xmlfile_id number primary key,
xmlfile_doc XMLType);

2. Insert the xml document:

insert into cagexml_col values (1,
XMLType (bfilename ('ING_FEED', 'CAGEDUNS.xml'),
nls_charset_id ('AL32UTF8')));

3. reading data:

Select xmlfile_id,
a.CAGE,
a.DUNS,
a.SRCFLAG
OF cagexml_col.
XMLTABLE ('/ tblCageDuns/CageDuns ')
PASSAGE cagexml_col.xmlfile_doc
COLUMNS
CAGE VARCHAR2 (5) Path "cage."
Path of VARCHAR2 (9) "duns, DUNS
SRCFLAG number Path 'SrcFlag '.
) a
where xmlfile_id = 1;



Here is an example of file CAGEDUNS.xml.

< tblCageDuns > < CageDuns > < cage > AAA87 < / cage > < duns > 111149236 < / duns > < SrcFlag > 0 < / SrcFlag > < / CageDuns > < CageDuns > < cage > BBB95 < / cage > < duns > 222245890 < / duns > < SrcFlag > 4099 < / SrcFlag > < / CageDuns > < CageDuns > < cage > CCC90 < / cage > < duns > 333368885 < / duns > < SrcFlag > 3 < / SrcFlag > < / CageDuns > < CageDuns > < cage > DDD14 < / cage > < duns > 444437379 < / duns > < SrcFlag > 3 < / SrcFlag > < / CageDuns > < CageDuns > < cage > EEE77 < / cage > < duns > 555597063 < / duns > < SrcFlag > 4097 < / SrcFlag > < / CageDuns > < CageDuns > < cage > FFF56 < / cage > < duns > 666639159 < / duns > < SrcFlag > 3 < /. SrcFlag > < / CageDuns > < CageDuns > < cage > GGG95 < / cage > < duns > 777745890 < / duns > < SrcFlag > 4097 < / SrcFlag > < / CageDuns > < CageDuns > < cage > HHH16 < / cage > < duns > 888882310 < / duns > < SrcFlag > 3 < / SrcFlag > < / CageDuns > < CageDuns > < cage > III50 < / cage > < duns > 999987789 < / duns > < SrcFlag > 3 < / SrcFlag > < / CageDuns > < CageDuns > < cage > JJJ69 < / cage > < duns > 000073027 < / duns > < SrcFlag > 3 < / SrcFlag > < / CageDuns > < CageDuns > < cage > KKK77 < / cage > < duns > 121297063 < / duns > < SrcFlag > 4099 < / SrcFlag > < / CageDuns > < CageDuns > < cage > LLL68 < / cage > < duns > 232300000 < / duns > < SrcFlag > 3 < / SrcFlag > < / CageDuns > < / tblCageDuns >


Here is the version information:

**********************************************************************************
SQL * more: Release 10.2.0.1.0 - Production on Mon 3 Oct 16:30:40 2011

Copyright (c) 1982, 2005, Oracle. All rights reserved.


Connected to:
Oracle Database 11 g Enterprise Edition Release 11.2.0.1.0 - 64 bit Production
With partitioning, OLAP, Data Mining and Real Application Testing options

MAX_INTF@romsprd SQL > select * from V$ VERSION
2.

BANNER
--------------------------------------------------------------------------------
Oracle Database 11 g Enterprise Edition Release 11.2.0.1.0 - 64 bit Production
PL/SQL Release 11.2.0.1.0 - Production
CORE 11.2.0.1.0 Production
AMT for Linux: Version 11.2.0.1.0 - Production
NLSRTL Version 11.2.0.1.0 - Production
**********************************************************************************

Is there a way to read what all the labels and the labels are in the xml file, so I can check them before I try to query the data?

You can try the following, it will return all of tag names in the order of the document:

select x.tagname
from cagexml_col t,
     xmltable('/descendant::*'
       passing t.xmlfile_doc
       columns tagname varchar2(30) path 'local-name(.)'
     ) x
;

If you want information on the hierarchy, perhaps something like described here: {: identifier of the thread = 2210708}

Tags: Database

Similar Questions

  • Please, give me an advise how to search for a number in a file xml (as3.0)

    Hello! Sorry for the troubling.

    Please, give me an advice how to search for a number in a file xml (as3.0)

    Thank you!

    My answer was based on your question to find numbers anywhere in the data to an xml file.  If you know that the data is digital data and the names of the nodes that contains this data, you do not have to check the characters and can only check numerical data using string values...

    function searchXMLFile(Event:MouseEvent):void
    {
    searchDisplay.text = "";
    var pageList:XMLList = xmlFileToSearch.receipt.number;
    searchDisplay.text = "false";
       
    for (var i: int = 0; i< pagelist.length();="">
    {

    If (pageList [i] == searchInput.text) {}
    searchDisplay.text = "true";
    }

    }
    }

    Even if you are looking for individual digital characters in the previous code that you would have always done by a false exit due having the line 'false' always cancel the real line...

    If (t.toString () .indexOf (m_sSearchTerm)! = - 1).

    {

    searchDisplay.text = "true";

    }

    searchDisplay.text = "false";  This will always overwrite the textfield

  • How do I get the number from a file xml for flash as3 area text 'Get_Days '?

    Hello

    I ended up at the daily update of the number of days since the specified days. Say, a work to be finished within 30 days. And the starting day is today. So, tomorrow it will be 29 days left. and so on...

    Thus, instead of reducing a number every day for the last number of days using the flash, it will be easy to change in the xml file.

    How can I do?

    I have a simple 'dynamic text box"text box and the name of the instance:"Days_Left. " Since I am a student, I can't do complex projects. I learn things that are small with very few lines of code that can be modified using xml files.

    So everything I type in a file xml, it must appear in a text box called "Days_Left".

    Thank you.

    You can use:

    var currentDate:Date = new Date();

    It is today
    var projectDueDate:Date = new Date (2010,11,29);

    use the date to the expiration date.

    months are zero-based.  (IE, jan for the month 0, dec is month 11)

    var daysToCompleteProject:Number = (projectDueDate.getTime()-currentDate.getTime())/(1000*60*60*24);

    This is the number of days between currentDate and projectDueDate.  You'll want to probably round or use days: hours: minutes for your display

  • How to read an int value to a file

    Hello programmers.

    I am facing a problem no doubt very simple but which has kept me stuck for some time, so I'm now looking for your help.

    int i = 0;

    try {}
    FileConnection fconn = (FileConnection) Connector.open (System.getProperty ("fileconn.dir.photos") + "increment.txt", Connector.READ_WRITE);
    If (fconn.exists ()) {}
    OutputStream os = fconn.openOutputStream ();
    String value = "1";
    OS. Write (value. GetBytes());
    OS. Close();
    InputStream is = fconn.openInputStream ();
    i = Integer.parseInt (is. ToString());
    is. Close();
    }
    If (! fconn.exists ()) {}
    fconn. Create() ;}
    fconn. Close();
    }
    catch (IOException ioe) {}

    I know that the file of the photo isn't the best idea, it's just a test. So, when I go into the increment.txt file, I see that a '1' is written, however, when I try to start it I get a NumberFormatException, do you know why and how I can solve this problem?

    Thank you very much for any help, I won't forget the congratulations...

    Yes indeed you're right, it works!

    Thanks a lot again Simon, you be everhelpfull in my daily programming efforts.

    Here is the final code that worked for me:

    InputStream is = fconn.openInputStream ();
    InputStreamReader isr = new InputStreamReader (is, "UTF8");
    StringBuffer buffer = new StringBuffer();
    int ch;
    While ((ch = isr.read ()) >-1) {}
    buffer. Append ((Char) ch) ;}

    Temp = buffer. ToString();
    Temp.Trim ();
    i = Integer.parseInt (temp);
    is. Close();

    Bravo to you, of course...

  • How to read the content .vmtx of the file using PowerCLI

    Hi all

    I have a virtual computer model in one of the NFS attached to my ESX host data stores.
    I need to get the display name and some other details of the vmtx this model file.
    Any method to get values from vmtx file using PowerCLI... ?

    Thank you in advace for all help.

    Hello, MattGeorgey-

    One way you could do this would be to use the Copy-DatastoreItem cmdlet to retrieve the .vmtx file, and then you can read it, Get-Content on it, etc., as you please.  Something like:

    ## copy the VMTX file from the datastore to a local spotCopy-DatastoreItem vmstore:\MyDatacenterName\my_datastore_name\myTemplate\myTemplate.vmtx C:\temp\.
    
    ## get the contents of the VMTX file$colVMTXContents = gc C:\Temp\myTemplate.vmtx## get the line that contains the "displayName" value$colVMTXContents | Select-String displayName
    

    And, you can access some of the elements that are specified in the file .vmtx using the property Config.ExtraConfig of the display of the model as object:

    ## get the template object$tmplMyTemplate = Get-Template myTemplate## get a particular value for an ExtraConfig item$tmplMyTemplate.ExtensionData.Config.ExtraConfig | ?{$_.Key -eq "nvram"}
    

    How do I?

  • How to read the NAVE of Nikon D600 files

    I bought a Nikon D600 but am unable to read NEF files read with my version of Lightroom 3 that works on an older Mac Book which cannot be upgraded to LR4.  If I buy a new Mac, can I switch to LR4 on the new machine, or I have to buy a new version?  If I can improve how to transfer LR3 for the new machine.  Also, I'm a student of Photoshop CS5 Extended version.  Can I buy an upgrade to CS6 on a new machine?

    In doing research I saw where 4 Lightroom and Photoshop CS6 had some problems with Apple OS X 10.8.  Have they been resolved?

    The D600 is made sound supported by Lightroom 4.2/camera Rw 7.2 and higher.  Then updgrading 4 Lightroom or Photoshop CS6 will provide full support for the D600. Alternatively, you can download the free 7.2 or later version DNG Converter and use to convert your NEF files to DNG format that is already supported by Lightroom 3.x

    You can spend to Lr4 Lr3 on your old or new machine has no activation code to stop. You'll probbaly prompted for the serial number for Lr3 on the new machine to prove that an upgrade is legitimate. Buy Photoshop CS6 then upgrading the new machine that is also possible, but you need either the DVD for CS5 or have already installed on the new machine. Basically, the CS6 needs to see a copy of CS5 is available for installation or already on the computer.

    Regarding problems with 10.8. They have been addressed.

    Download link for DNG converter 7.3 http://www.adobe.com/support/downloads/detail.jsp?ftpID=5518

    Download link for 4.3 Lr http://www.adobe.com/support/downloads/detail.jsp?ftpID=5520

  • How to read the Thai language in .txt file?

    AttN; Who may apply.

    How read txt file in another language (Asian language like Japanese, thai or Korea)?

    Please let me know urgent... I have to use emergency...

    Best regards

    SAE

    Hello CAs,
    Welcome to the community of Sony.

    What is the model number of the digital book reader?

    The reader supports text formats (.txt) as well as the two following formats:
    -File EPUB (.epub) EPUB (version 2.0 of PAHO) taken in charge
    -PDF file (.pdf) support is based on the PDF 1.6 specification.

    The default language on your Reader Digital Book setting does not affect the language in which the book is. Reading in a foreign language, you will have to buy them specifically in this language.

    Thank you for your message.

  • How to read my waveform data from a file LVM?

    I have collected a form of wave and saved using the file LVM format. I would read the waveform in labview and view with its timestamp and assigned name. The only way that I could read the data in Labview was to convert it to an array of number. I thought that if you could write a waveform and save all data, you should be able to read it back quite easily. I have included my LVM file and two simple programs. The program I use is much larger, but these two programs are representative of what I'm trying to accomplish.

    Thank you

    Eric,

    I am pleased that you have something that can work even if it is not ideal.
    I close this service request, but I thought that I'll let you know that
    because of your issues, I have revised article in the Knowledge Base on
    timestamps and verified for accuracy and thought you should know.

    What is the precision of the timestamp of the waveform returned by my NOR-DAQmx
    Device?
    http://digital.NI.com/public.nsf/allkb/5D42CCB17A70A06686256DBA007C5EEA?OpenDocument

    Concerning

    Vince Methot
    Technical sales engineer
    National Instruments

  • How to read the write in HTML5 extension file

    Hello

    I think it could be very generic question since moving from Flex to HTML5 extension loses the ability to read write a file in the local file system.

    I'm writing a log within the space of the extension file but it throws error asTypeError: illegal constructor '

    new File(csInterface.getSystemPath(SystemPath.EXTENSION)+"/log/Log_"+.getCurrentDateString+".txt");
    

    did someone solve this.

    Thanks in advance

    MM

    Hello

    Why are you not using NODE.js as code below:

    var fs = require ("fs");

    var logfile = ' /extension_log.txt '; .

    .

    .

    .

    fs.appendFile (logfile, "expedition save\n", function (err) {if (err) throw err ;});)

    .

    .

    .

    Ten

  • How to read markers placed in an audio file of the hearing... in Flash?

    I'm a Flash novice Pro user. I have a voice on the soundtrack recorded in Adobe Audition. I inserted markers at various points (words) in the audio file. I need to get events in Flash when the words are spoken. Can anyone refer me to a method for playback (sound cues) markers in Flash? I just need a few key words so I can this research.  I would appreciate a tutorial on that as well.

    Thank you very much.

    Post edited by: paul_james123

    This works. Thanks again, Rob. You've been a great help.

  • How to import symbols (α, β, γ, δ, etc.) of a file xml for indesign

    Hello world...

    I have an xml file that contains symbols such as α, β, γ, δ, etc..

    I want to import this xml file with symbols in the Indesign document,

    symbols should appear under the name appearing in the xml file, they appear as empty space.

    Is it possible, if possible then please tell me...

    Thank you very much in advance...

    I have a solution to display mathematical symbols in the indesign document.

    By setting the "Minion Pro Regular" Style so that the symbols...

    Thanks for looking at my Question...

  • VBAI: How to read a shared variable?

    I'm doing my inspection to do things that depend on the value of shared Variables. How to set the VBAI Shared variables, it is obvious, but I didn't understand how to read them and then create some kind of a structure of MATTER using this variable.

    Any ideas on how to implement such an architecture?

    I create two different States and use the transitions that are based on the value of the shared variable. You can read the value of the variables or the previous measures in stages that allow this (not all stages, but most don't) or transitions. To create a new State, go to the state diagram (click on the 'toggle window view hand' so the State-transition diagram is in the main part of the window). Right click in an empty part of the state diagram and select "create a new State".

    To create a transition, right-click on a State and select 'Create a new Transition' and drag the transition to the new State.

    To change the transition, double click it and you will be able to select the shared variable as measurement, and comparison operations to make the decision. If this comparison is false, the default transition is taken instead.

    Select help > Show context Help if you change the schema of the State for more details on how to use it.

    Hope this helps,

    Brad

  • How to read these .dmp files to figure out what made my computer crash?

    For some time now, I've been crashing when playing some games on my computer and I can't for the life of understand me how to read the dump of the computer files.

    http://www.sendspace.com/filegroup/8Gj9VzD2SKc7%2FIy4d%2BMmMbokVjIju92H
    These are the files to dump.

    Theres a problem with your nvidia driver & installation of DirectX

    BlueScreenView or WinDbg can help reading dmp files

  • How to read digital signals with pre-and post-trigger on a card PCI-6251

    I have 22-bit parallel position of data entering TTL lines to 16 kHz with a pulse of marker that says when the data is valid. I also have a fault line which gives an impulse when an error condition is met. I want to read in the 22 lines of position with 500 positions of pre-event and post-event 500 data when the fault line says. How do I pre and post-déclencher lines digital input on a card PCI-6251?

    If this is not possible on this map, which maps PCI would be possible?


  • How to read and write FileGlobals with TestStand ActiveX control in c#

    Hello everyone,

    I'm trying to read and write FileGlobals with TestStand ActiveX control in c#.

    I tried with:

    SequenceContext contextOfTraceMsg = e.thrd.GetSequenceContext (0, out frameId);

    var filepara = contextOfTraceMsg.FileGlobals.GetSubProperties ("ProjectParameter.NestIsTested", 0). GetValue (1); (NestIsTested is an array of Boolean)

    but without success.

    Can someone tell me how to do it right?

    Thank you in advance!

    Concerning

    0049 wrote:

    Hello Doug,

    Thanks for the reply.

    It works to read a Boolean value. How to read the table of Boolean?

    Kind regards

    For a table you can either do:

    (1) myarray [] bool = contextOfTraceMsg.FileGlobals.GetValVariant ("myarray", 0);

    Or

    (2) using GetNumElements() and GetValBooleanByOffset().

    -Doug

Maybe you are looking for