Question about insert date value from xml file

I want insert value into table from xml file. Every time I inserted value of date type into the table, I got the unpasable error message as following:
oracle.xml.sql.OracleXMLSQLException: Exception 'java.text.ParseException:Unpars
eable date: "2000-04-19 00:00:00.0"' encountered during processing ROW element
Thanks for anyone that can fix my problem or give me any suggestion.
email: [email protected]

<BLOCKQUOTE><font size="1" face="Verdana, Arial">quote:</font><HR>Originally posted by matmnwx:
I want insert value into table from xml file. Every time I inserted value of date type into the table, I got the unpasable error message as following:
oracle.xml.sql.OracleXMLSQLException: Exception 'java.text.ParseException:Unpars
eable date: "2000-04-19 00:00:00.0"' encountered during processing ROW element
Thanks for anyone that can fix my problem or give me any suggestion.
email: [email protected]<HR></BLOCKQUOTE>
Use:
OracleXMLSave sav = new OracleXMLSave(conn,tabName);
sav.setDateFormat(<hier the date format in the XML-File>);

Similar Messages

  • How to retrieve value from xml file

    hi all,
    can somebody pls tell me how to retrieve value from xml file using SAXParser.
    I want to retrieve value of only one tag and have to perform some validation with that value.
    it's urgent .
    pls help me out
    thnx in adv.
    ritu

    hi shanu,
    the pbm is solved, now i m able to access XXX no. in action class & i m able to validate it. The only thing which i want to know is it ok to declare static ArrayList as i have done in this code. i mean will it affect the performance or functionality of the system.
    pls have a look at the following code snippet.
    public class XMLValidator {
    static ArrayList strXXX = new ArrayList();
    public void validate(){
    factory.setValidating(true);
    parser = factory.newSAXParser();
    //all factory code is here only
    parser.parse(xmlURI, new XMLErrorHandler());     
    public void setXXX(String pstrXXX){          
    strUpn.add(pstrXXX);
    public ArrayList getXXX(){
    return strXXX;
    class XMLErrorHandler extends DefaultHandler {
    String tagName = "";
    String tagValue = "";
    String applicationRefNo = "";
    String XXXValue ="";
    String XXXNo = "";          
    XMLValidator objXmlValidator = new XMLValidator();
    public void startElement(String uri, String name, String qName, Attributes atts) {
    tagName = qName;
    public void characters(char ch[], int start, int length) {
    if ("Reference".equals(tagName)) {
    tagValue = new String(ch, start, length).trim();
    if (tagValue.length() > 0) {
    RefNo = new String(ch, start, length);
    if ("XXX".equals(tagName)) {
    XXXValue = new String(ch, start, length).trim();
    if (XXXValue.length() > 0) {
    XXXNo = new String(ch, start, length);
    public void endElement(String uri, String localName, String qName) throws SAXException {                    
    if(qName.equalsIgnoreCase("XXX")) {     
    objXmlValidator.setXXX(XXXNo);
    thnx & Regards,
    ritu

  • Data Load from XML file to Oracle Table

    Hi,
    I am trying to load data from XML file to Oracle table using DBMS_XMLStore utility.I have performed the prerequisites like creating the directory from APPS user, grant read/write to directory, placing the data file on folder on apps tier, created a procedure ‘insertXML’ to load the data based on metalink note (Note ID: 396573.1 How to Insert XML by passing a file Instead of using Embedded XML). I am running the procedure thru below anonymous block  to insert the data in the table.
    Anonymous block
    declare
      begin
      insertXML('XMLDIR', 'results.xml', 'employee_results');
      end;
    I am getting below error after running the anonymous block.
    Error :     ORA-22288: file or LOB operation FILEOPEN failed”
    Cause :   The operation attempted on the file or LOB failed.
    Action:   See the next error message in the error stack for more detailed
               information.  Also, verify that the file or LOB exists and that
               the necessary privileges are set for the specified operation. If
               the error still persists, report the error to the DBA.
    I searched this error on metalink and found DOC ID 1556652.1 . I Ran the script provided in the document. PFA the script.
    Also, attaching a document that list down the steps that I have followed.
    Please check and let me know if I am missing something in the process. Please help to get this resolve.
    Regards,
    Sankalp

    Thanks Bashar for your prompt response.
    I ran the insert statement but encountered error,below are the error details. statement.
    Error report -
    SQL Error: ORA-22288: file or LOB operation FILEOPEN failed
    No such file or directory
    ORA-06512: at "SYS.XMLTYPE", line 296
    ORA-06512: at line 1
    22288. 00000 -  "file or LOB operation %s failed\n%s"
    *Cause:    The operation attempted on the file or LOB failed.
    *Action:   See the next error message in the error stack for more detailed
               information.  Also, verify that the file or LOB exists and that
               the necessary privileges are set for the specified operation. If
               the error still persists, report the error to the DBA.
    INSERT statement I ran
    INSERT INTO employee_results (USERNAME,FIRSTNAME,LASTNAME,STATUS)
        SELECT *
        FROM XMLTABLE('/Results/Users/User'
               PASSING XMLTYPE(BFILENAME('XMLDIR', 'results.xml'),
               NLS_CHARSET_ID('CHAR_CS'))
               COLUMNS USERNAME  NUMBER(4)    PATH 'USERNAME',
                       FIRSTNAME  VARCHAR2(10) PATH 'FIRSTNAME',
                       LASTNAME    NUMBER(7,2)  PATH 'LASTNAME',
                       STATUS  VARCHAR2(14) PATH 'STATUS'
    Regards,
    Sankalp

  • XML data upload from .xml file

    Hi,
    Can anyone let me know is ther any way how I can upload the data from .xml file into Oracle Table.
    Note: I just want to upload the data from xml file; not entire .xml file.
    I have data like as below in test.xml file and I want to upload the data only into TEST_EMP table:
    <?xml version = '1.0'?>
    <ROWSET>
    <ROW num="1">
    <TABLE_NAME>DEPT</TABLE_NAME>
    <TABLESPACE_NAME>USERS</TABLESPACE_NAME>
    </ROW>
    <ROW num="2">
    <TABLE_NAME>EMP</TABLE_NAME>
    <TABLESPACE_NAME>USERS</TABLESPACE_NAME>
    </ROW>
    <ROW num="3">
    <TABLE_NAME>BONUS</TABLE_NAME>
    <TABLESPACE_NAME>USERS</TABLESPACE_NAME>
    </ROW>
    <ROW num="4">
    <TABLE_NAME>SALGRADE</TABLE_NAME>
    <TABLESPACE_NAME>USERS</TABLESPACE_NAME>
    </ROW>
    <ROW num="5">
    <TABLE_NAME>BHAVESH_EMP</TABLE_NAME>
    <TABLESPACE_NAME>USERS</TABLESPACE_NAME>
    </ROW>
    </ROWSET>
    Any help would be highly appreciated!!
    Thanks... Bhavesh

    One way is to use sql* loader...
    http://download-west.oracle.com/docs/cd/B19306_01/appdev.102/b14259/xdb25loa.htm

  • Select Between two date ranges from xml file

    Hi ,
    I have a column date_ with datatype VARCHAR2(150) it stores
    data as
    05/19/2010 11:23 AM
    05/20/2010 12:23 PM
    05/22/2010 11:23 AM
    05/25/2010 11:23 AM
    i have to select all the rows between 05/19/2010 and 05/22/2010 how to do that this column is in xml file

    I have a table wit two fields
    Field1 is integer and field2 is xmltype
    in the xmltype i store an xml file
    <ParentNode>
    <Node>
    <Cat>1</Cat>
    <Date>05/19/2010 11:23 AM </Date>
    </Node>
    <Node>
    <Cat>2</Cat>
    <Date>05/20/2010 12:23 PM </Date>
    </Node>
    <Node>
    <Cat>3</Cat>
    <Date>05/22/2010 11:23 AM </Date>
    </Node>
    </Parentnode>
    I am using teh below query to retrive teh result
    SELECT T.Feild1, XML.* FROM Tablename T,
    XMLTable( 'Parentnod/Node' PASSING T.Feild2 COLUMNS Cat NUMBER PATH 'Cat' ,
    DATE_ VARCHAR2(100) PATH 'Date'
    )XML where cat >1;
    now i have to do teh same to select the rows between two date range 05/19/2010 and 05/21/2010
    hope i am able to make teh question simple

  • Insert the record from XML file to Tables.

    Hi guys,
    I ill be getting the XML file from FRONT-END.It ill be stored one permanent location(Directory).I need to Insert the data to the corresponding table.Anybody knows Pls give some suggestion for this.......
    Regards....
    GKM

    Using the Oracle XML DB Webdav are is one method as it acts like a file system, but essentially get's the documents directly into the database so they can be queried through the resouce_view.
    Other methods involve reading the file as if it's a CLOB and then using XMLTYPE constructor to change that CLOB to an XMLTYPE which can then be stored as that datatype in the database or processed as you need.
    The best place to look is over in the XML DB forum, which has it's own FAQ detailing various best practices for all sort of XML stuff, including reading XML files and shredding them into relational tables etc.
    {thread:id=410714}
    Edited by: BluShadow on 18-Jan-2012 08:53
    corrected link

  • How to get the values from xml file to java combo box

    Hi frens,
    I am new to java and xml programming,
    Now, i want to have a code of getting the tag values from the xml file
    into the swing combo box of java front end.
    How can we do that?
    any help of code or tutorial or an ebook is a great help for me.
    Thank you,
    Karthik.
    Edited by: Karthik84 on Aug 27, 2008 1:49 AM
    Edited by: Karthik84 on Aug 27, 2008 11:29 PM

    look at this link
    http://www.stylusstudio.com/docs/v2006/d_help30.html
    I read sometime back that castor has a tool to do
    conversion. You might have a look into casto as well.

  • How to insert date value through xml in oracle

    hi,  I am inserting data using xml string. Everything is working perfect but it shows error when i try to insert data into a table with date coloumn. it shows unparsable date error.... I am using this format of date 1-jan-2011
    my prcedure and java method is as follows...
    CREATE OR REPLACE procedure app_data.Insert_callrepHeader(xmlDoc in CLOB,t_id out varchar2,flag out varchar2) is
    insCtx DBMS_XMLSave.ctxType;
    rows number;
    t_tablename VARCHAR2(300);
    t_seqval varchar2(100);
    begin
    t_tablename:='T_CALLREPORT_HDR';
    insCtx := DBMS_XMLSave.newContext(t_tablename);
    rows := DBMS_XMLSave.insertXML(insCtx,xmlDoc);
    dbms_output.put_line(to_char(rows) || ' rows inserted');
    DBMS_XMLSave.closeContext(insCtx);
    select SEQ_T_CALLREPORT_HDR.currval into t_seqval from dual;
    dbms_output.put_line(to_char(t_seqval) || ' is the current sequence number');
    end;
    public void insertAll(String[][] dbTblFieldValues) throws Exception
    Connection conn=null;
    conn=getOracleConnection();
    try
    String str="<ROWSET>"+
    "<ROW>"+
    "<PROCESSNAME>sheet</PROCESSNAME>"+
    "<FK_EMPID>1</FK_EMPID>"+
    "<FK_JRNY_PLAN_HDR_ID>278</FK_JRNY_PLAN_HDR_ID>"+
    "<FK_DIVISIONID>3</FK_DIVISIONID>"+
    "<STARTDATE>7-may-2011</STARTDATE>"+ what should be the format of this date????_+
    "<COMMENTSFORWEEK>comment</COMMENTSFORWEEK>"+
    "<SAPCODE>mysapcode300</SAPCODE>"+
    "<WEEKNO>1</WEEKNO>"+
    "<TOTALEXPENSE>800</TOTALEXPENSE>"+
    "<VENDORINVOICETYPE>mytype</VENDORINVOICETYPE>"+
    "<REPORTNO>1</REPORTNO>"+
    "<SUBPROCESSID>800</SUBPROCESSID>"+
    "</ROW>"+
    "</ROWSET>";
    StringBuffer sb = new StringBuffer(400000);
    sb.append(str);
    String clobValue = sb.toString();
    PreparedStatement preparedStatement=conn.prepareStatement("{call INSERT_CALLREPHEADER (?,?,?)}");
    preparedStatement.setString(1, clobValue);
    preparedStatement.setString(2,null );
    preparedStatement.setString(3,null );
    preparedStatement.execute();
    preparedStatement.close();
    conn.close();
    catch (Exception e) {
    // System.out.println(e.getMessage());
    e.printStackTrace();
    }

    I have got the answer...
    use DBMS_XMLSave.setdateformat(insCtx, 'dd-MM-yyyy'); and u can change ur date format....

  • Look-up name value from XML file based on user entered number value

    My form has an "Employee Number" numeric field and an "Employee Name" textfield. I want the user to enter their employee number and have JavaScript that will "look-up" that employee number in the XML data file and return the corresponding Employee Name into the employee name textfield. I need an example XML data file and form with the appropriate script.
    Can anyone help me with this?

    Hi ,
    Re-read your post, find that the col2 in List1 is people and group type column, SharePoint Lookup type column showing additional fileds option does not support people and group type column, so there should be no OOB method to achieve your
    goal.
    http://techtrainingnotes.blogspot.com/2012/01/sharepoint-not-all-column-types-can-be.html
    I think you can try using InfoPath form to manipulate the correspond col2 value when lookup col1 from List1 then show in list view, or may use custom visual web part to achieve you goal.
    http://sharepointsolutions.com/sharepoint-help/blog/2011/11/get-infopath-to-display-lookup-column-value-not-id/
    Thanks
    Daniel Yang
    TechNet Community Support

  • How to retrieve image from XML  file

    Hi All,
    I am new to XML. So any best guidance is appreciated.
    The application requirement is to display image retrived from uploaded xml file in file upload section of our application. And store that image in database.
    In my XML file , images & strings & numbers & booleans are there . I am able to save everything in database except images .
    I am using JSF, Seam & Hibernate combination. In my Hibernate entity class i took BLOB datatype for image.
    I am using following tags in my Xhtml file to display image
    <s:graphicImage value="#{hibernateentitybean.picBlobtype}" height="200" width="200">
    <s:transformImageSize width="200" height="200" />
    <s:transformImageType contentType="image/jpeg"/>
    But image is not displayed in Xhtml file
    I am using org.w3c.dom.Document for retrieving node name & corresponding value in that node in XML file.
    I am getting code like below for Image when i am logging all values from XML files in my bean class .
    x0lGQRQAAAABAAAAAAAAAFJHAQARAAAAVwBhAHQAZQByACAAbABpAGwAaQBlAHMALgBqAHAAZwAAAP/Y/+AAEEpGSUYAAQIBAGAAYAAA/+0YLl
    I want to convert this value to image. So i can convert image to bytes and store in BLOB.
    Can anyone guide me ? or any other approach .
    Thanks in advance for any reply.
    Regards,
    Naresh

    Dan_Koldyr wrote:
    agree, it's really odd. Just reread OP and it says:
    NareshDharmiVatsal  wrote:
    want to convert this value to image. In any case it doesn't get worth then another single code line:
    final String cdata = "x0lGQRQAAAABAAAAAAAAAFJHAQARAAAAVwBhAHQAZQByACAAbABpAGwAaQBlAHMALgBqAHAAZwAAAP/Y/+AAEEpGSUYAAQIBAGAAYAAA/+0YLl";
    final sun.misc.BASE64Decoder decoder = new sun.misc.BASE64Decoder();
    final byte[] data = decoder.decodeBuffer(cdata);
    Blob blob = new SerialBlob(data);//or what ever other DB-specific blob implementaiton Did i answered original question? Any more comments to my first replay?I can comment on this latest code. The package sun.misc is private to Sun (Oracle now of course). It is undocumented and may change or be removed altogether in a future release. There is a good free open source Base64 decoder in the Jakarta Commons Codec library.

  • 1.6 Dynamic Photo Gallery - alt and title attributes from xml file?

    Hi!
    I would like to attach information to my gallery images from
    the XML-file used by the gallery.
    Especially the alt and title attributes for the "img
    id="mainImage"-tag would add a bit more user friendliness.
    I found
    this
    example about adding caption to images very help full and
    everything worked just fine, thanks to clear information!
    (http://www.adobe.com/cfusion/webforums/forum/messageview.cfm?forumid=72&catid=602&threadi d=1306782&enterthread=y)
    Could someone come up with an example of adding title/alt
    attributes values from XML file?
    I'm sure there are quite a few out ther who would like to see
    a solution to this ;)

    You need to add your info to the XML.
    So something like:
    <photo
    path = "travel_01.jpg"
    width = "263"
    height = "350"
    title="my title"
    alt_text="Alt Text"
    thumbpath = "travel_01.jpg"
    thumbwidth = "56"
    thumbheight = "75">
    </photo>
    Then in your detailregion:
    <img src="{dsData::large/@base}{@path}" alt="{@alt_text}
    title="{@title}" />
    I am using
    http://www.adobe.com/devnet/dreamweaver/articles/spry_photo_album.html
    as the source of my samples...
    So, just add the data to the XML and then you will have these
    attributes available as data references.
    Hope this helps.
    Don

  • How to insert date value into oracle?

    hi,
    iam reading date from xml using vb.net and inserting it into oracle table.
    the date value in xml file is in the format of "01012003".
    i want to insert into oracle table.but iam getting an error "ORA-1843: not a valid month".
    how to solve this problem.
    Any suggestions or examples...

    That's not a date. It's just a string. Convert it to a date using,
    DateTime d = DateTime.ParseExact("01022003", "MMddyyyy", null);
    or
    Dim d As DateTime = DateTime.ParseExact("01022003", "MMddyyyy", Nothing)
    and then bind it to a parameter. ODP.NET will take it from there.
    You should never be hard-coding the date literal into your SQL query.
    David

  • Reading from XML file is too slow

    I am trying to read some values from XML file, it takes about 1 or 2 minutes to finish reading, my xml file has about 4000 xml elements. Does anyone know this is normal or something wrong? How could make it faster?
    Thank you

    fine if it helps others... i hope NI will not be angry *fg*
    thx for your bug-report, i do not test the sub.vi until now.
    exchange the OR with an AND, solves the problem with the endless-loop, but error checking will not work (the loop only stops if no error AND no start-tag is found)
    changing the loop termination condition and putting the NOT from the error condition to the no_starttag_flag do both. correctly stops the loop when error occurs OR no further elements found.
    i attached the new sub.vi for version 7.0 and 7.1, also but some colors in the logo, for your convinience
    catweazle
    Attachments:
    xmlFile_GetElements_(Array).vi ‏76 KB
    xmlFile_GetElements_(Array).vi ‏65 KB

  • Read bool value from xml

    Hi all :
    I try to read Boolean value from xml file , please see attach file , all the time this error rise
    I know that The XML tag describing the type of data does not match, how can I get Boolean value " 1" or "0 "
    Thanks
    wisam
    Attachments:
    untitled1.JPG ‏115 KB

    You are not trying to read boolean.. you are trying to read a DBL.
    To read a DBL you must first write a DBL to XML.
    To read a boolean replace the DBL with a boolean

  • XML parser for fatching multiple values from XML

    Hi,
    In my scenirio i have to facth multiple values from XML file and then set in to Table in webdynpro...
    Fo example my xml has values like...
    <xml>
         <item>
              <item1>
                   <quantity>
                        100
                   </quantity>
                   <price>
                        50
                   </price>
              </item1>
              <item2>
                   <quantity>
                        200
                   </quantity>
                   <price>
                        20
                   </price>
              </item2>
              <item3>
                   <quantity>
                        300
                   </quantity>
                   <price>
                        10
                   </price>
              </item3>
         </item>
    </xml>
    then i have to fcath those quantity and price and set in to table...
    How to do taht in webdynpro and does any one have parser code for retriving multiple values...

    Hi,
    1) You need to use JDOM parser.
    2) The code for parsing XML using JDOM parser is readily available if you search on google.
    3) You will have to check the attribute during every parsing and then if attribute is quantity you can fetch the corresponding tags.
    4) Something similar to this:
    org.jdom.Document document = parser.build(file);
                    org.jdom.Element rootElement = document.getRootElement();
                    org.jdom.Element childElement = rootElement.getChild("file");
                    Element xmlElement = childElement.getChild("item");
                    if (xmlElement != null) {
                        List itemElementsList = xmlElement.getChildren("item1");
                        if (itemElementsList != null) {
                            Iterator iterator3 = itemElementsList.iterator();
                            while (iterator3.hasNext()) {
                                //For each group get quantity
                                Element itemElement = (Element) iterator3.next();
                                List quantityElementsList =
                                        itemElement.getChildren("quantity");
                                if (quantityElementsList != null) {
                                    Iterator iterator2 =
                                            quantityElementsList.iterator();
                                    while (iterator2.hasNext()) {
    // Your code                                                                               
    You might need to make some changes as per your rquirement. Just use this sample to understand how you need to parse the xml
    Hope it helps.
    Regards.
    Rajat
    Edited by: Rajat Jain on Jan 22, 2009 9:51 AM

Maybe you are looking for

  • How do i delete an old iPad from my iCloud? I have restored the iPad to factory settings but it is still showing in my iCloud.

    How do I delete an old iPad from my iCloud? I have restored the iPad to its factory settings and linked my new iPad however the old one is still showing in my iCloud.

  • Installing 11i on Solaris and migrating 8.0.5 to new 8.1.6 database

    I've installed 11i (several times) on a new Sun solaris server. I also selected it to install a fresh database. On another server we have 11.0 and 8.0.5 database. We are using a new server to install 11i and we want to move our database over. I manag

  • System command in Process chain

    Hello, I have a system command in the process chain which points to a command file that is supposed to run. My problem is that when I transport the PC, the path on the system command remains same. I want it to change the path from /md.... in dev to /

  • How to convert bmp to jpg or gif??

    hi all. I would like to store image into database and retrieve it. But I don't know the method that can show bmp image. So I need to convert it before keep in database in type of jpg or gif? Can you give me any suggestion? or if you know how to show

  • Photoshop Elements 13 Help Please

    I have just upgraded from Elements 11 to Elements 13 on my Mac and a few things are different so have some questions that i hope someone can answer. 1) Can the annoying suggested crop feature be turned off? 2) Every photo that i load into elements, w