having a problem with parsing the XML file

Hi all
I am trying to get data from XML file
I want to only 4-5 values in this XML file
Here is an example of XML file
-< transaction >
-< TransCtx >
> < pAMETranType > IRCVACAPPROVAL < / pAMETranType >
> < / TransCtx >
> < / transaction >

I want to add value and to store this value in table
I'm here, I want to "IRCVACAPPROVAL".
the tag
< pAMETranType >

for this purpose


I created a procedure

CREATE OR REPLACE PROCEDURE insert_xml_emps (p_directory in varchar2,
> p_filename in varchar2)
(> vtableName in varchar2) as
> v_filelocator BFILE.
> v_cloblocator CLOB.
> l_ctx DBMS_XMLSTORE. CTXTYPE;
> l_rows NUMBER;
> v_amount_to_load NUMBER;
> dest_offset NUMBER: = 1;
> offset NUMBER: = 1;
> lang_context NUMBER: = DBMS_LOB. DEFAULT_LANG_CTX;
> WARNING NUMBER;
> START
> dbms_lob.createtemporary (v_cloblocator, true);
> v_filelocator: = bfilename (p_directory, p_filename);
> dbms_lob.open (v_filelocator, dbms_lob.file_readonly);
> v_amount_to_load: = DBMS_LOB.getlength (v_filelocator);
>-* this line is changed * -.
> DBMS_LOB. LOADCLOBFROMFILE (v_cloblocator,
> v_filelocator.
> v_amount_to_load.
> dest_offset.
> offset.
> 0,
> lang_context.
(> warning);
>
> l_ctx: = DBMS_XMLSTORE.newContext (vTableName);
> DBMS_XMLSTORE.setRowTag (l_ctx, 'TRANSACTION');
> DBMS_XMLSTORE.setRowTag (l_ctx, 'TRANSCTX');
>-clear the update settings
> DBMS_XMLStore.clearUpdateColumnList (l_ctx);
>-set the columns to update a list of values
> DBMS_XMLStore.setUpdateColumn (l_ctx, 'PAMETRANTYPE');
>
>-now insert the doc.
> l_rows: = DBMS_XMLSTORE.insertxml (l_ctx, v_cloblocator);
> DBMS_XMLSTORE.closeContext (l_ctx);
> dbms_output.put_line(l_rows ||) "... inserted rows. ») ;
> dbms_lob.close (v_filelocator);
> DBMS_LOB. FREETEMPORARY (v_cloblocator);
> END;

I also have on the table who get this value

whenever I call that created the procedure
it sometime gives an error or sometime run correctly but store null in the table


But when I change the XML file
as
When convert all lowercase letters in the capital then it works fine

Is tehre to other ways to parse the XML file with no change in the XML file?

Did you use the same test (with the exception of file name and directory) case?

What I posted is a copy/paste direct SQL * Plus, and it works on version 11.2.0.1.

Tags: Database

Similar Questions

  • How can I parse the XML file using the Oracle's Sql query.

    Hi all
    I have an XML file that must analyze and display the result according to the following example
    Can you please recommend me an approach to get the result.

    For example, here is my XML:

    <? XML version = "1.0" encoding = "UTF-8"? >
    < xmlns:pi = "urn:com.workday / picof pi: Extract_Employees" >
    < IP: employee >
    < Additional_Information: pi > < pi: pi function: PriorValue = "" > Intern - masteri¿½s < / pi: function >
    < / pi: Additional_Information >
    < / pi: employee >
    < / pi: Extract_Employees >

    Databases:

    Oracle Database 10 g Enterprise Edition release 10.2.0.3.0 - production

    SQL > SELECT * FROM NLS_DATABASE_PARAMETERS;

    NLS_LANGUAGE AMERICAN
    NLS_TERRITORY AMERICA
    NLS_CURRENCY $
    NLS_ISO_CURRENCY AMERICA
    NLS_NUMERIC_CHARACTERS.,.
    WE8ISO8859P1 NLS_CHARACTERSET
    NLS_CALENDAR GREGORIAN
    NLS_DATE_FORMAT DD-MON-RR
    NLS_DATE_LANGUAGE AMERICAN
    NLS_SORT BINARY
    NLS_TIME_FORMAT HH.MI. SSXFF AM
    NLS_TIMESTAMP_FORMAT-DD-MON-RR HH.MI. SSXFF AM
    NLS_TIME_TZ_FORMAT HH.MI. SSXFF AM TZR
    NLS_TIMESTAMP_TZ_FORMAT DD-MON-RR HH.MI. SSXFF AM TZR
    NLS_DUAL_CURRENCY $
    BINARY NLS_COMP
    NLS_LENGTH_SEMANTICS BYTES
    NLS_NCHAR_CONV_EXCP FAKE
    NLS_NCHAR_CHARACTERSET AL16UTF16
    NLS_RDBMS_VERSION 10.2.0.3.0



    The Xml file above with UTF-8 character sets which is multi bytes.

    But in my character database is WE8ISO8859P1 for example ISO-8859-1 (single-byte character set)

    SQL > SELECT extractValue (Value (x) ', ' / pi:Employee/pi:Additional_Information/pi:Job_Title','xmlns:pi="urn:com.workday/picof ' ')
    TABLE (XMLSequence (extract (XMLType (bfilename('XMLDIR','XML_Issue_227176.xml'), nls_charset_id ('AL32UTF8')),'/ pi: Employee ',' xmlns:pi="urn:com.workday/picof"'))) x;)))


    which gives the following error:

    Error:
    ORA-31011: XML parsing failed
    ORA-19202: an error has occurred in the processing of XML
    LPX-00200: could not convert from UTF-8 encoding to ISO-8859-1
    Error on line 1
    ORA-06512: at "SYS." XMLTYPE", line 295
    ORA-06512: at line 1

    Also I tried with this
    SQL > SELECT convert (extractValue (Value (x), ' / pi:Employee/pi:Additional_Information/pi:Job_Title','xmlns:pi="urn:com.workday/picof"'),'WE8ISO8859P1 ', 'UTF8'))
    TABLE (XMLSequence (extract (XMLType (bfilename('XMLDIR','XML_Issue_227176.xml'), nls_charset_id ('AL32UTF8')),'/ pi: Employee ',' xmlns:pi="urn:com.workday/picof"'))) x;)))

    The same error is according to the above error message.

    Please help in this regard.

    Thank you and best regards,
    Sandrine

    You know the code of real character behind "" or you receive the file like that?

    For the record, "" is the wildcard of UTF-8 (0xEFBFBD), so that the original character of the means has already been replaced and that very probably the file was not coded properly in the first place.

    With respect to the resolution of the problem, try another method to read the file:

    SQL> select value from nls_database_parameters where parameter = 'NLS_CHARACTERSET';
    
    VALUE
    ----------------------------------------
    WE8ISO8859P15
    
    SQL> SELECT x.*
      2  FROM XMLTable(
      3         XMLNamespaces(default 'urn:com.workday/picof')
      4       , '/Extract_Employees/Employee'
      5         passing xmltype(
      6                   dbms_xslprocessor.read2clob(
      7                     'COP_DIR'
      8                   , 'XML_Issue_227176.xml'
      9                   , nls_charset_id('AL32UTF8')
     10                   )
     11                 )
     12         columns job_title varchar2(30) path 'Additional_Information/Job_Title'
     13       ) x
     14  ;
    
    JOB_TITLE
    ------------------------------
    Intern -  Master¿s
     
    
  • Parse the XML file and extract data

    I want to parse a XML file and get the data as columns.

    Input country.xml file:

    <?xml version="1.0" encoding="UTF-8"?>
    <MAS Action="Insert">
    <Country ObjectId="100000000000000009" VersionId="8"><Id>1</Id><NlTexts><Name Language="de">Land1</Name><Name Language="en">Country1</Name></NlTexts></Country>
    <Country ObjectId="100000000000000033" VersionId="2"><Id>2</Id><NlTexts><Name Language="de">Land2</Name><Name Language="en">Country1</Name></NlTexts></Country>
    </MAS>
    
    

    I would like to analyze the xmlfile to get the following result

    Required result:

    col1        col2           col3
    1            Land1        Country1
    2            Land2        Country2
    

    or alternatively

    col1  col2       
    1            Land1       
    1            Country1
    2            Land2       
    2            Country2
    

    I tried the extract function

    select extract((XMLTYPE(BFILENAME('XML_DAT_DIR', 'country.xml'),
               NLS_CHARSET_ID('AL32UTF8'))) , '/*/*/Id') as "xdata"
    from dual;
    
    xdata
    ------------------------
    <Id>1</Id><Id>2</Id>
    

    and XMLTABLE (but how can I add countries now)

    SELECT *
        FROM XMLTABLE('/*/*/Id'
               PASSING XMLTYPE(BFILENAME('XML_DAT_DIR', 'country.xml'),
               NLS_CHARSET_ID('AL32UTF8'))
           )
      ;
    COLUMN_VALUE
    ------------------------
    <Id>1</Id>
    <Id>2</Id>
    

    DB version 11.2.0.3 on Windows 64-bit

    Thank you

    Tim

    Here are a few examples.

    For your output required:

    SELECT *.

    FROM XMLTable)

    "/ MAS/country".

    from XMLType (bfilename ('TEST_DIR', 'country.xml'), nls_charset_id ('AL32UTF8'))

    number of columns col1 way "Id".

    , col2 varchar2 (30) path "NlTexts/name [1].

    , col3 varchar2 (30) path "NlTexts/name [2]»

    )

    ;

    or, if the Language attribute is significant:

    SELECT *.

    FROM XMLTable)

    "/ MAS/country".

    from XMLType (bfilename ('TEST_DIR', 'country.xml'), nls_charset_id ('AL32UTF8'))

    number of columns col1 way "Id".

    col2 varchar2 (30) path "NlTexts/Name[@Language="de"]"

    col3 varchar2 (30) path "NlTexts/Name[@Language="en"]"

    )

    ;

    For your alternate exit:

    SELECT x1.col1

    x2.col2

    -, x2.col3

    FROM XMLTable)

    "/ MAS/country".

    from XMLType (bfilename ('TEST_DIR', 'country.xml'), nls_charset_id ('AL32UTF8'))

    number of columns col1 way "Id".

    , path of xmltype names ' NlTexts/name '.

    ) x 1

    XMLTable)

    "/ Name".

    in passing x1.names

    path of column col2 varchar2 (30) '.'

    -, col3 to ordinalite

    ) x 2

    ;

    (uncomment col3 to see what he does)

    or in a shorter way:

    SELECT *.

    FROM XMLTable)

    ' for $i/MAS/country

    , $j in $ NlTexts/i/name

    Returns the r element {$i / Id, $j}'

    from XMLType (bfilename ('TEST_DIR', 'country.xml'), nls_charset_id ('AL32UTF8'))

    number of columns col1 way "Id".

    , col2 varchar2 (30) path 'name '.

    ) ;

  • Need help with loading the XML file

    Hello

    I spent reviewing the web/forums for an example on how to do this for a few days now.  I managed to get this working in Flash Pro easily enough, but I think I'm missing something when I want to do the same thing in Flex.

    Basically, I want to load an XML file and then set the values of the text of labels 5, equal to the data in the XML file.

    So I have a button created in MXML and have put the following click event:

    Click = "dsSetup (Event)" "

    I also stated the following:

    public var myRequest:URLRequest = new URLRequest ("assets/myFile.xml");   folder located under the CBC in project

    public var myLoader:URLLoader = new URLLoader();

    public var myXML:XML;

    My function that loads is as follows:

    public function dsSetup(event:MouseEvent):void

    {

         trace ("dsSetup");

    myXML = new XML (myLoader.data);

    H3. Text = myXML.source.itemA;

    H4.text = myXML.source.itemB;

    H5.text = myXML.source.itemC;

    H7.text = myXML.source.itemD;

    H8.text = myXML.source.itemE;

    currentState = "MainMenu";

    }

    myLoader.addEventListener (Event.COMPLETE, dsSetup);   I think that this line is no longer as I put it in the MXML

    myLoader.load (myRequest);

    It's the way I did in Flash and it worked fine, but I must be missing something when it comes to Flex.

    Can you explain or point me to a good tutorial that shows how to load XML in Flex code?

    Those I've found seems to have about 50 lines of code just to load a file and add through a complex for a beginner.

    Thank you very much

    I suggest you save the data loaded in a variable that can be linked, then bind the properties of the text - who:

    [Bindable]

    var myXML:XML;

    public void dsSetup(event:MouseEvent):void

    {

    myXML = new XML (myLoader.data);

    currentState = "MainMenu";

    }

    ...

  • Inability to parse the XML file

    Podcasts connect tells me that it cannot parse the following URL.  You can determine why?  The URL http://www.nudge.online/Protest/Podcasts/hungerstriker.xml

    I followed, as far as possible, the advice provided by PodcastConnect

    Line 18 of your food

    < height > 144 < / height >

    The misspelling has given rise to the 'height' never closed and thus invalidate the rest of the food.

  • Having a problem with signing the cloud today

    This is what happens when I connect

    Capture.jpg

    Capture.jpg

    Hi JJMack,

    Please follow the steps mentioned below:

    Close the creative cloud application.

    Navigate to the OOBE folder.

    Windows: [system drive]: \Users\ [user name] \AppData\Local\Adobe\OOBE

    Mac OS: /Users/ [user name] / folder/Library/Application Support / Adobe / OOBE

    Delete the file opm.db.

    Launch the creative cloud.

    Let us know if this helps,

    -Pascal

  • I'm having a problem with the FireFox browser. I have attached two files that describe the problem. I have marked their A &amp; B. A is the way it should lo

    I'm having a problem with the FireFox browser. I have attached two files that describe the problem. I have marked their A & B. A is how it should look like and B what happens once I have, I opened several tabs. I can get it back to normal if I click VIEW, click Customize. When the window customize appears that Firefox returns to its normal state. I have to click on the done button and go back to what I did. I tried to reset FireFox back to the default settings, but that has not fixed the problem.
    It started happening a month. Is there a way I can fix this? Thanks for your help. I don't know how to fix my 2 attachments that shows the problem I'm having.
    [email address removed to protect your privacy and security]

    Try disabling hardware acceleration in Firefox.

  • iOS: problem with loading the content of an xml file placed on a server

    So, I have an app that loads a few small things (pictures and text) of a xml/php file on the server. Everything works fine on both android and in the flash debugger, but when I install the ipa file on my iPhone my IOErrorEvent displays an error message. When the xml file and example photos come with the app (they are not on the server, but in the ipa file) everything works perfectly. There is something about iOS that prevents me to load all the data from the server, it seems. There must be a way around it.

    I would be grateful for advice.

    Kind regards

    Array must be table.

  • Problem with the date when you load the XML file into Oracle Database 10g

    Hi all

    I have the interface as shown in the screenshot below. In this document, among other things, I am mapping to an element XML file representing a date to an Oracle table column defined as DATE. The source and target columns are highlighted in the screenshot.

    ! http://img223.imageshack.us/img223/1565/odiscr275.jpg!

    When I run the interface, I get the following error message:

    java.lang.IllegalArgumentException to java.sql.Date.valueOf(Date.java:103)

    I guess that this is the conversion of the date!

    I already tried to replace SRC_TRADES. DEAL_DATE with TO_DATE (SRC_TRADES. DEAL_DATE, ' DD/MM/YYYY') on the implementation tab. This feature was not recognized when I executed the interface, so it did not work! The value of date in the XML file is in the format DD/MM/YYYY .

    I guess that Date SQL Oracle functions do not work in the implementation tab. Could someone let me know:

    1. what the Date Conversion function I could use instead?
    2. where can I find a reference to the methods/functions that I use in the implementation tab (if such a reference exists)?

    See you soon.

    James

    Hello.

    Try changing the area of execution at the staging area. Once you change it, write in the map box just SRC_TRADERS. DEAL_DATE. When you use TO_DATE, the source field typu should be varchar2, no date (as it is in store for your data source)

  • Having a problem with Windows Live Mail lock up shortly after the start.

    Having a problem with Windows Live Mail lock up shortly after the start. When I start the Task Manager to end the process, it sometimes freezes and the only way to solve the problem is to disconnect which forces the profile to close. Assuming a corrupted profile, I followed the instructions of Windows support to fix a corrupted profile and copied all the files except ntuser.*. When I try to paste them into the new user profile (all profiles are admins), I get the error message asking if I want to leave to proceed. When I click on continue, all THE files in the profile block "corrupt" to the new one, including ntuser.*, that I was not choosing. Why? If the files are rewritten empty? Tried 3 times, same result. Please notify.

    I think I found it! I went in the Windows Live Forum and found a thread that looked like my problem. He suggested going to msconfig and take off Live Mail list start. I couldn't find it on the list, but the top element was "" default EXE"something of an unknown manufacturer. I took it out of the startup list, and Live Mail works again! Thanks for your help!

  • Having a problem with the Gallery of filters, specifically the texture and the other 5 filter filter do not meet the 'OK '.

    Having a problem with the Gallery of filters, specifically the texture and the other 5 filter filter do not meet the 'OK '.

    Go to the Photoshop preferences, then on the performance tab.

    From there please click on advanced settings, change the drawing on 'Basic' mode and uncheck the option for "Open CL" once, then try with a Jpeg file.

  • Having a problem with the Muse crashing when opening a Web site I designed in Muse.

    Having a problem with the Muse crashing when opening a Web site I designed in Muse. You need to be able to access this site in order to update for my clients.

    [LASP/updateCaches] TypeError: Error #1009: cannot access a property or method of a null object reference.

    All adventures Rafting | Wenatchee Whitewater Rafting trips - two hours East of Seattle

    Could you please send us the .muse file to [email protected] as well as a link to this topic? If the file is larger than 20 MB, you can use a service like Adobe SendNow, Dropbox, WeTransfer, etc.. Thank you.

  • I keep having problems with 3ds and .obj files

    Any time I try to import a 3ds file I get errors saying that I don't have enough RAM. Say they cannot parse the EPS files. I have 8 GB of RAM, so this seems unlikely. I've looked everywhere for a solution to this.

    My ultimate goal is to take a model of MacBook Pro in Photoshop import into After Effects.

    For some reason it works ever.

    I'm on an i7 MacBook Pro 2011 with 8 GB of RAM. 10.6.8 running

    Any help would be appreciated.

    Hi Jason,

    Thanks for the links. Nice samples.

    On the model, there are a few things. The holes to vent on each side of the keyboard is primarily what causes the problem of load. When explode you all nested components, there are more than 100 entities K and I'm guessing that the importer of collada Ps is not like that. "Undesirable" Triangulating you see comes from faces in collision. If you go to 3D > render... settings and check the 'remove back faces' section face Style, your Ray Trace should look much better.

    Here's what I came up with the deleted holes (let me know if you want the source of .dae or psd files):

    I saw something large on the use of the Ps in After Effects 3D layers. The General interop has some major roadblocks. I'll see if I can get some tips for you (you ask or heard from Todd Kopriva?)

    Kind regards

    Steve

  • Static load of the XML file with the list of choices

    Hello

    So let me explain my problem:

    -J' have XML files: (in my < fx:Declaration >)
    < fx:XML id = "flexang" source = "xml/flex - ang.xml" / >
    < fx:XML id = "flexastro" source = "xml/flex - astro.xml" / >
    < fx:XML id = "flexber" source = "xml/flex - ber.xml" / >

    -J' have a list constructed as follows:

    (in my < fx:Declaration >)

    < fx: Model id = "anim" >
    States <>
    < label State = data="animations/flex-ang.swf"/ "Anguinéa" >
    < label State = "Retrograde motion" data="animations/flex-astro.swf"/ >
    < label State = "Rod of Bérard" data="animations/flex-ber.swf"/ >
    < / states >
    < / fx: Model >


    (and then)

    < mx:List id = 'source' width = '100% ', color = 'blue '.
    dataProvider = "{anim.state}" "
    change = "selectedListItem .selectedItem = list (event.currentTarget);" / > "

    (with public var selectedListItem:Object ;)


    My list is designed to load dynamicaly some SWF files

    < mx:SWFLoader id = "animation".
    source = "{selectedListItem.Data}" "
    autoLoad = 'true '.
    Width="100%"/ >

    -But now I want to display the correspondent. So I tried to build the string to the XML of the selectedListItem.data id:

    private void xmlFile(swf:String):String
    {
    var pref:String;
    var tab = swf.split (".", 2);
    Tab = Tab [0]. Split("/",2);
    Pref = tab [1];
    Pref pref =. Split("-"). Join("");
    return of pref;
    }

    This gives me, for example, "flexang" of "animations/flex - ang.swf. But my problem is that I want to put my XML file in my region RichText:

    < s:RichEditableText id = 'codeView' editable = textFlow = "{TextFlowUtil.importFromXML (xmlFile (selectedListItem.data)) 'false'}" / > "

    But xmlFile returns a string! and I don't know how to specify that it is an XML ID.

    I hope I am clear enough.

    Thank you if you try to help me

    Wait, that wasn't fair.  Try:

    TextFlow = "{TextFlowUtil.importFromXML (this [xmlFile (selectedListItem.data)])}

    "

  • Fill the tree with complex external XML file control

    Hi all. I've been combing through forums for two days and have not been able to find a solution to my problem. I'm trying to populate a control of the tree with an external xml file, but the xml file is not a simple. It is complex, and I don't know how to get the tree to display these data. I have attached the code. Can someone take a look and let me know how I could get this to work? Thank you!

    What does not work?

    Complexity of the XML is not, in itself, an issue for the tree.

    Also, I recommend using straight XML, unless specifically, you need Collection features.

    Tracy

Maybe you are looking for

  • Lighnting calendar used to synchronize with Google calendar

    With the help of Windows 8.1Have Thunderbird and Lightning.Then set up the new calendar to sync with my google calendar. synchronization does not work.When you attempt to create an event I get error Code of State "MODIFICATION_FAILED": 2147746065, th

  • Satellite Pro S500-139 - FN + F9 key does not have to turn off the touchpad

    Hello I use a Satellite Pro S500-139 and am having problems with my F9 key. When I tap my palm touches the mouse and send the cursor somewhere else on the page. I reinstalled the ALPS pointing device and now have access to the Advanced setting that I

  • Message on each normal closed

    I just re-formatted my hard drive and put on a new copy of windows xp. Now every time I shut down the computer, I get a box to answer "Ending the program" on a file "ccApp. Someone knows how to fix this?

  • How can I install Paperport Version 11.1

    I have been informed that Windows 7 doesn't support Paperport Version 11.1.  There will be a patch to allow installation of this program?

  • Cannot download files on dell

    I have a dell 64-bit with windows 7. Im trying to download the adobe flash player, but whenever I press run application it says this: error "Windows cannot access the specified device, path or file. You can't have appropriate permission to access the