How to save XML timeformat to oracle without loosing "timezone-compensati"

I hope i post this in the correct forum and I provide enough info for you to understand what I'm looking for...
Some time ago I got some help here about how to read a incoming XML-file and insert data into a table, where the Element-tag describes the tablename and the Attributes describes the column-names. See post : [ https://forums.oracle.com/forums/message.jspa?messageID=10284116#10284116]
During testing we discovered that on some incoming messages there where Date-fields, the date/time-values has the format '2012-04-19T14:00:05+02:00' which causing us problems when saving the value to our oracle table.
This is (simplifyed) how the message look like:
<?xml version="1.0" encoding="UTF-8"?>
<PickResult>
<Metadata>
<TransactionIdentity>"00000011"</TransactionIdentity>
<MessageTypeIdentity>"MyMessageType"</MessageTypeIdentity>
<MessagePartyIdentity>"02"</MessagePartyIdentity>
</Metadata>
<Data>
<PickResult PickingTime="2012-04-19T14:00:05+02:00" ProductDate="2012-04-20" Picker="MyEmployee" />
</Data>
</PickResult
I've tried different types on the PICKINGTIME-column like "DATE", "TIMESTAMP" and "TIMESTAMP(6) WITH LOCAL TIME ZONE" but I still get oracle errors like
"ORA-01858: a non-numeric character was found where a numeric was expected"
"ORA-01861: literal does not match format string"
when I run the statement.
If I declare the PICKINGTIME-column as "DATE" it works without errors but it doesn't add the two extra hours(+02:00) to the time which is very importent since the Picking time must be accurate.
This is the how the "final" Insert-statement look like which I need to modify somehow to make it accept the timeformat from the message:
INSERT INTO PickResult( PICKER, PICKINGTIME, PRODUCTDATE)
SELECT PICKER, PICKINGTIME, PRODUCTDATE
FROM XMLTable('/PickResult/Data/descendant::PickResult'
PASSING :1 COLUMNS
PICKER varchar2(35) path '@PICKER'
, PICKINGTIME date path '@PICKINGTIME'
, PRODUCTDATE date path '@PRODUCTDATE')
Can anyone provide me with some input how to solve this problem because I'm totally stucked...
ps. please forgive me for my poor "technical" english.
//Peter

Hi,
PickingTime="2012-04-19T14:00:05+02:00"xs:dateTime format is mapped to TIMESTAMP (WITH TIME ZONE) in SQL.
This works for me :
SQL> select * from v$version;
BANNER
Oracle Database 10g Enterprise Edition Release 10.2.0.5.0 - 64bi
PL/SQL Release 10.2.0.5.0 - Production
CORE     10.2.0.5.0     Production
TNS for 64-bit Windows: Version 10.2.0.5.0 - Production
NLSRTL Version 10.2.0.5.0 - Production
SQL>
SQL> SELECT PICKER, PICKINGTIME, PRODUCTDATE
  2  FROM XMLTable('/PickResult/Data/descendant::PickResult'
  3  PASSING xmltype('<?xml version="1.0" encoding="UTF-8"?>
  4  <PickResult>
  5  <Metadata>
  6  <TransactionIdentity>"00000011"</TransactionIdentity>
  7  <MessageTypeIdentity>"MyMessageType"</MessageTypeIdentity>
  8  <MessagePartyIdentity>"02"</MessagePartyIdentity>
  9  </Metadata>
10  <Data>
11  <PickResult PickingTime="2012-04-19T14:00:05+02:00" ProductDate="2012-04-20" Picker="MyEmployee" />
12  </Data>
13  </PickResult>')
14  COLUMNS
15    PICKER      varchar2(35)              path '@Picker'
16  , PICKINGTIME timestamp with time zone  path '@PickingTime'
17  , PRODUCTDATE date                      path '@ProductDate'
18  )
19  ;
PICKER                              PICKINGTIME                                       PRODUCTDATE
MyEmployee                          19/04/12 14:00:05,000000 +02:00                   20/04/2012

Similar Messages

  • How to save to .doc or .rtf without loosing formatting

    Hi, I have to submit academic assignments with either .doc or .rtf file extensions. However, in the University there is a protocol for headers and footers so that the assignment is anonymous and when quoting from reference documents we have to indent paragraphs. When writing this is pages and exporting to .doc or .rtf all of the formatting gets lost. If I submit these without the right formatting, I will get marked down. They will not accept .pdf, which works OK - how can I save in .doc or .rtf without loosing the formatting?

    Hi Peter Breis, you have suggested soemthing that works which is the first line and left paragraph indents but this still does not work with tabs. The .rtf is not a solution becaue of the need for headers and footers (with pages numbers). In the .rtf file they just appear at the end of the text rather than a header and footer.
    Anyway, in summary, thank you Peter, you have given me a solution that works which is to indent using first line and left paragraph indents and to export into a .doc document. The headers and footers export without a problem using this method. I will nominate all the extra marks that I will get from following the University's protocol to you!, Thanks!

  • HELP!!!! How to save xml file!!!Anyone can help???

    Hi,
    It is urgent for me to know how to save xml file. I use VC++6.0, Oracle xdk 9.0.0.0.0 or 9.0.0.0.0Abeta under windows98.
    It is OK to compile the program with print() method. But system will tell me there is illegal operation when I run it. If I delete the line with print(), the result will be normal.
    in class node, there is two functions
    void print(ostream *out = &cout, uword level = 0,uword step = 4);
    void print(DOMString buffer, size_t bufsize, uword level = 0, uword step = 4);
    Is there anyone who may tell me how to use them? to write back specific xml file?
    Without print(), I can not save the xml file...It seems in Oracle xdk9.0.0.0.0, there is no obvious function to save the file.(or because I am a new comer , not familier with DOM)
    Can anyone tell me how to save xml file? or just paste an example! It is very a little urgent to me...Hope you give me some ideas....
    Many thanks in advance!!!!
    yours,
    Fiena

    Hi,
    goto sxmb_adm > intergration engine configration > specific configration
    go in edit mode > new entry
    choose
    Category -> IDoc
    Parameters -> XML_CONVERSION
    current value -> 2
    Regards,
    Manisha

  • How to create xml file from Oracle and sending the same xml file to an url

    How to create xml file from Oracle and sending the same xml file to an url

    SQL/XML (XMLElement, XMLForest, XMLAgg, etc) and UTL_HTTP.
    Whether that works for you with the version of Oracle you have, your requirements, and needs is another story. A little detail goes a long way.

  • How fast text search field in Oracle without using Intermedia?

    How fast text search field in Oracle without using Intermedia? Thank you, Paul.

    yes,it is overriden in VOImpl
    public void executeQuery()
            setQuery((new StringBuilder()).append(selectStmt).append(" order by ").append(getOrderByClause()).toString());
            OAApplicationModuleImpl oaapplicationmoduleimpl = (OAApplicationModuleImpl)getApplicationModule();
            OAApplicationModuleImpl _tmp = oaapplicationmoduleimpl;
            if(oaapplicationmoduleimpl.isLoggingEnabled(1))
                OAApplicationModuleImpl _tmp1 = oaapplicationmoduleimpl;
                oaapplicationmoduleimpl.writeDiagnostics((new StringBuilder()).append(getClass().getName()).append(".executeQuery").toString(), (new StringBuilder()).append(" Query:").append(getQuery()).toString(), 1);
            super.executeQuery();
    But I have extended VO and substituted the VO . In the substituted VOImpl, instead of executeQuery(),I have written
    public void customExecuteQuery()
              setQuery((new StringBuilder()).append(selectStmt).append(" order by ").append(getOrderByClause()).toString());
              executeQuery();
    Will this work,or do I need to do any changes?
    Thanks,

  • How to save from .ai to .png without a gap

    I created a repeating pattern. I made the artboard the exact size of the art. I zoomed in and there are no gaps around the edge. I saved it for web and devices png8 and the top has a gap with transparency showing through. When I use it as a web page background, there is a white stripe showing. I've tried twice to resave it but get the same gap.
    I'm trying to upload the two images using the camera icon but nothing happens after I select the image and click the "insert image" button. Again, I've tried twice without a different result. Please advise.
    Thank you.
    Please help.
    Kathleen

    Having a hard time with google docs, sigh. Thank you for all your help.
    From: "Kurt Gold" <[email protected]>
    To: "kathpoole" <[email protected]>
    Sent: Tuesday, May 28, 2013 1:29:21 PM
    Subject: How to save from .ai to .png without a gap
         Re: How to save from .ai to .png without a gap
    created by Kurt Gold in Illustrator - View the full discussion
    Adobe Illustrator files are not tolerated as attachments in that Adobe Illustrator forum (great, isn't it?).
    You may take a service like Google Docs to provide them.
    Please note that the Adobe Forums do not accept email attachments. If you want to embed a screen image in your message please visit the thread in the forum to embed the image at http://forums.adobe.com/message/5359346#5359346
    Replies to this message go to everyone subscribed to this thread, not directly to the person who posted the message. To post a reply, either reply to this email or visit the message page: http://forums.adobe.com/message/5359346#5359346
    To unsubscribe from this thread, please visit the message page at http://forums.adobe.com/message/5359346#5359346. In the Actions box on the right, click the Stop Email Notifications link .
    Start a new discussion in Illustrator by email or at Adobe Community
    For more information about maintaining your forum email notifications please go to http://forums.adobe.com/message/2936746#2936746 .

  • How to save xml output of fm into sap as xml

    how to save xml output of fm into sap as xml
    thank you,
    regards,
    Jagrut bharatkumar shukla

    Hi Jagrut
    The XML document can be stored in an ABAP variable rxml of the type STRING or XSTRING, or in an internal standard table sxml of the elementary line type C. Hence, I believe, your issue with the lenght can be resovled with this types.
    For rxml, you specify an interface reference variable of the type IF_IXML_OSTREAM that points to an IXML output stream.
    For rxml, you specify an interface reference variable of the type IF_IXML_DOCUMENT that points to an IXML document.
    With the stream factory you have several options. Before you call your CALL TRANSFORMATION, you setup your stream factory for these different options.
    1. You want to write the file to the application server file system. You want to create your OSTREAM as a binary string. In this example b_xml is an empty binary string. OSTEAM will be the reference variable of tyep IF_IXML_OSTREAM.
    ostream =
    streamfactory->create_ostream_xstring( b_xml ).
    You get the output lenght with the following:
    ressize = ostream->get_num_written_raw( ).
    You can then send the entire string to the file system with the following:
    transfer b_xml to filename1 length ressize.
    Also refer to this weblog:
    /people/tobias.trapp/blog/2005/05/04/xml-processing-in-abap-part-1
    Regards
    Ravish Garg
    <b>
    *Remember reward points is the best way to say thank you :)</b>

  • How do i change my icloud email without loosing any of my current emails

    how do i change my icloud email without loosing any of my current emails

    You couldn't change your primary email address (only aliases are possible, which wouldn't affect your stored emails). If you would like to have a new primary @icloud.com address, then you would have to create a new account.

  • How do I lighten up a sequence without loosing color and contrast?

    how do I lighten up a sequence without loosing color and contrast?

    What have you tired so far? Color correction can be a bit of a challenge until you get comfortable with it.
    Also, unless your sequence is one uniform scene, it would probably be better to go on a clip by clip basis to make these adjustments - but here is one quick way to do it for the whole sequence, which may or may not give you the results you are looking for:
    Apply an Adjustment Layer that covers the duration of your sequence.
    Apply the Fast Color Corrector to the Adjustment Layer.
    In the settings for the Fast Color Corrector, bring up the Input Gray level a bit (this will lighten the scene) and raise the Input Black Level (this will help restore some of the contrast). If you need to make the bright portions of the scene brighter, bring down the Input White Level.
    Go slowly with small adjustments and  adjust to taste. You'll need to work back and forth on those controls to get the best compromise.
    If you want more color, increase the Saturation a small amount.
    MtD

  • How do I upgrade from 3.5 without loosing cookies?

    How do I upgrade from 3.5 without loosing all cookies? I have tried installing 10 and 13 but neither will read existing cookies and will also essentially delete them. (i.e. when I revert back to 3.5 the cookies are gone.)

    I have not tried upgrading from 3.5 to 10 or 13, but see no reason why the cookies should be lost.
    Are you using multiple versions of Firefox, if so to prevent problems you should use a separate profile for each version. To try to prevent loss of cookies back up your Firefox profile and keep it somewhere safe outside of any firefox program or profile path.
    I am not sure what you are now trying to do. If your cookies are already deleted then you now have no cookies to loose on updating. Or is it some other setting or data you are concerned about.
    See also
    * http://kb.mozillazine.org/Cookies#Where_are_cookies_stored
    * http://kb.mozillazine.org/Multiple_cookies_files_created
    * [[Back up and restore information in Firefox profiles]]
    * http://kb.mozillazine.org/Using_multiple_profiles_-_Firefox

  • How to start XML reports in Oracle Apps

    Hi All,
    As im new to develop XML reports in Oracle Apps. And Im used to develop oracle reports. But i have a new requirement came and i need to develop new XML reports.
    I am using windows please let me know any software to be installed and how to register the XML reports.
    1) how to create .rtf
    2) How to make columns mapping in rtf file.
    If any knows please let me know as it is bit urget for me.
    Im leaving in Duabi, if any is intrested to teach me i will join or pls let me know any instute
    Thanks,

    Assuming that you intend to create a layout template to use against an existing report, then you should start by changing the output type in the concurrent program definition to XML. You should then run the report and save the XML file output. This will form the start point for yout layout template.
    In order to create the layout template, you need to download the BI Publisher desktop. This is the add-in for Word which is used to build the template.
    When you have these tasks completed, you can open up Word and you will find you have some new menu options. Load the XML data you created in the first step, and you can build your template. You will also be able to preview the output from within Word.
    When you have completed the template, you need to go into XML Publisher responsibility. You should create a data definition which has a code the same as the concurrent program short name. This is the link between the template and the concurrent program.
    You then need to define a template for this data definition which will have the layout template uploaded.
    Having done this, switch to systeem administration responsibility, select the concurrent program menu entry and query back the program you are workin on. Click on the 'update' icon. You then need to click on the 'Onsite setting' tab. This allows you to attach the template to the program.
    Hope this helps.

  • ABAP Simple Transformation - How to save XML to file with CL_FX_WRITER?

    Hello!
    When calling a Simple Transformation program for transformation from ABAP to XML, it is possible to specify RESULT XML rxml as a class reference variable of type CL_FX_WRITER, which points to an XML writer.
    How to handle CL_FX_WRITER in order to save XML to a file?
    Thanks and regards,
    Andrey

    Hallo Rainer!
    Many thanks. I have checked the profile parameter ztta/max_memreq_MB and it is set to 2048 MB in the development system. I hope, that won't be less on the client's machine. The only thing I did not clearly explained, is that I need to write XML data to the server. I am so sorry. Downloading to the local PC is very helpful for me also, but only for the test purposes.
    Regards,
    Andrey

  • How to store XML data into Oracle Table

    I had trouble to store XML data into Oracle Table with XDK (Oracle 8.1.7 ). The error is:
    C:\XDK_Java_9_2\xdk\demo\java\Test>java testInsert Dept.xml
    <Line 1, Column 1>: XML-0108: (Fatal Error) Start of root element expected.
    Exception in thread "main" oracle.xml.sql.OracleXMLSQLException: Start of root element expected.
    at oracle.xml.sql.dml.OracleXMLSave.saveXML(OracleXMLSave.java:2263)
    at oracle.xml.sql.dml.OracleXMLSave.insertXML(OracleXMLSave.java:1333)
    at testInsert.main(testInsert.java:8)
    Here is my xml file:
    <?xml version = '1.0'?>
    <ROWSET>
    <ROW num="1">
    <DEPTNO>10</DEPTNO>
    <DNAME>ACCOUNTING</DNAME>
    <LOC>NEW YORK</LOC>
    </ROW>
    <ROW num="2">
    <DEPTNO>20</DEPTNO>
    <DNAME>RESEARCH</DNAME>
    <LOC>DALLAS</LOC>
    </ROW>
    <ROW num="3">
    <DEPTNO>30</DEPTNO>
    <DNAME>SALES</DNAME>
    <LOC>CHICAGO</LOC>
    </ROW>
    <ROW num="4">
    <DEPTNO>40</DEPTNO>
    <DNAME>OPERATIONS</DNAME>
    <LOC>BOSTON</LOC>
    </ROW>
    </ROWSET>
    and here is structure of table:
    Name Null? Type
    DEPTNO NOT NULL NUMBER(2)
    DNAME VARCHAR2(14)
    LOC VARCHAR2(13)
    and here is my Java Code:
    import java.sql.*;
    import oracle.xml.sql.dml.OracleXMLSave;
    public class testInsert{
         public static void main(String[] args) throws SQLException{
              Connection conn = getConnection();
              OracleXMLSave sav = new OracleXMLSave(conn,"scott.tmp_dept");
              sav.insertXML(args[0]);
              sav.close();
              conn.close();
         private static Connection getConnection()throws SQLException{
              DriverManager.registerDriver(new oracle.jdbc.driver.OracleDriver());
              Connection conn = DriverManager.getConnection("jdbc:oracle:thin:@amt-ebdev01:1521:mydept","scott","tiger");
              return conn;
    Could you help me ? Thanks !

    The problem is that you need to pass avalid URL , Document...
    Please try this code instead:
    import java.net.*;
    import java.sql.*;
    import java.io.*;
    import oracle.xml.sql.dml.OracleXMLSave;
    public class testInsert
    public static void main(String[] args) throws SQLException{
    Connection conn = getConnection();
    OracleXMLSave sav = new OracleXMLSave(conn,"scott.temp_dept");
    URL url = createURL(args[0]);
    sav.insertXML(url);
    sav.close();
    conn.close();
    private static Connection getConnection()throws SQLException{
    DriverManager.registerDriver(new oracle.jdbc.driver.OracleDriver());
    Connection conn = DriverManager.getConnection("jdbc:oracle:thin:@dlsun1982:1521:jwxdk9i","scott","tiger");
    return conn;
    // Helper method to create a URL from a file name
    static URL createURL(String fileName)
    URL url = null;
    try
    url = new URL(fileName);
    catch (MalformedURLException ex)
    File f = new File(fileName);
    try
    String path = f.getAbsolutePath();
    // This is a bunch of weird code that is required to
    // make a valid URL on the Windows platform, due
    // to inconsistencies in what getAbsolutePath returns.
    String fs = System.getProperty("file.separator");
    if (fs.length() == 1)
    char sep = fs.charAt(0);
    if (sep != '/')
    path = path.replace(sep, '/');
    if (path.charAt(0) != '/')
    path = '/' + path;
    path = "file://" + path;
    url = new URL(path);
    catch (MalformedURLException e)
    System.out.println("Cannot create url for: " + fileName);
    System.exit(0);
    return url;

  • How to save formula items in oracle forms?

    Dear All........
    I am nw in this forrum, can anybody plz tell me how to save forumula items in database, I also make that fields as a database field but it is not save in database. plz tell me. thx.

    Dear!
    Steps to take formula column value into database field, follow following steps:
    1. Draw a text field named "Formula_Cell"and set its properties which you want for formula. Now, goto its "Database" property set to "No".
    Now, goto its "Canvas" Property set to "Null".
    2. Now, in Pre-Insert or Pre-Update trigger use following code:
    Suppose database field name is AMOUNT then:
    :AMOUNT := :FORMULA_CELL;
    If you want to mension block names with this then you may do.
    Remeber, Formula Column's property of Database must be set to No.
    Now, try to save I hope you will got a good solution...

  • How to connect iphone to new computer without having the old one?  The hard drive on my macbook broke, so I had to install a system from scratch. I now cannot reconnect my iPhone. How can I set the new computer without loosing my data on the iPhone?

    Recently the hard drive on my mac book was damaged beyond repair and I had to reinstall the OS.
    MY iPhone still has all its original dta.
    How can I connect my iPhone to my computer (virtually new) without loosing the data I have on my iPhone?
    Obviously I cannot recover any of the old itunes files.
    Thanks,

    Some of the information below has subsequently appeared in a document by turingtest2: Recovering your iTunes library from your iPod or iOS device - https://discussions.apple.com/docs/DOC-3991
    Your i-device was not designed for unique storage of your media. It is not a backup device and media transfer was planned with you maintaining a master copy of your media on a computer which is itself properly backed up against loss. Syncing is one way, computer to device, updating the device content to the content on the computer, not updating or restoring content on a computer. The exception is iTunes Store purchases which can be transferred to a computer.
    iTunes Store: Transferring purchases from your iOS device or iPod to a computer - http://support.apple.com/kb/HT1848 - only purchases from iTunes Store
    For transferring other items from an i-device to a computer you will have to use third party commercial software. Examples (check the web for others; this is not an exhaustive listing, nor do I have any idea if they are any good):
    - Expod (free) - http://www.headlightsoft.com/expod/ - Mac, universal for 104.+ (newer machines try de-Tune)
    - deTune (free) - http://www.headlightsoft.com/detune/ - Mac, 10.5+
    - Senuti - http://www.fadingred.com/senuti/
    - Phoneview - http://www.ecamm.com/mac/phoneview/
    - MusicRescue - http://www.kennettnet.co.uk/products/musicrescue/
    - Sharepod (free) - http://download.cnet.com/SharePod/3000-2141_4-10794489.html?tag=mncol;2 - Windows
    - Snowfox/iMedia - http://www.mac-videoconverter.com/imedia-transfer-mac.html - Mac & PC
    - iexplorer (free) - http://www.macroplant.com/iexplorer/ - Mac&PC
    - Yamipod (free) - http://www.yamipod.com/main/modules/downloads/ - PC, Linux, Mac [Still updated for use on newer devices? No edits to site since 2010.]
    - 2010 Post by Zevoneer: iPod media recovery options - https://discussions.apple.com/message/11624224 - this is an older post and many of the links are also for old posts, so bear this in mind when reading them.
    Syncing to a "New" Computer or replacing a "crashed" Hard Drive - https://discussions.apple.com/docs/DOC-3141 - dates from 2008 and some outdated information now.
    Copying Content from your iPod to your Computer - The Definitive Guide - http://www.ilounge.com/index.php/articles/comments/copying-music-from-ipod-to-co mputer/ - Information about use in disk mode pertains only to older model iPods.
    Get Your Music Off of Your iPod - http://howto.wired.com/wiki/Get_Your_Music_Off_of_Your_iPod - I am not sure but this may only work with some models and not newer Touch, iPhone, or iPad.
    Additional information here https://discussions.apple.com/message/18324797

Maybe you are looking for

  • Can i use xl inkt cartridges in a hp c310 photosmart

    The printer has now 364 setup cartridges. The XL cartridges don't fit into the holder. DO I have tio change the holder or isn't possible to do ths?

  • Print the form data instead of whole page

    Hello All, I am having a problem in my ADF/JSF page. I just want to print the form data of my form instead of the whole page.using javascript:print() method prints the whole page.so can you help me in solving this issue. I have JDev 10.1.3 and do not

  • Value miss match

    Hi Gurus, Anyone help me in reportingside. here i am facing a problem when query execution.I had developed a query on Stock Category satement.In that query i took quantity(0VALSTCKQTY) and value(0VALSTCKVAL).These two are Non-cummulative keyfigures.

  • Missing file box suing media icon

    When I click on the media icon in iweb or garageband, the photo button. I get a box that says looking for Far, Far Away 03 movie file; I click on cancel, then a box that says Zoom 02.dv comes up, i click cancel and then the photos come up and I can u

  • How to transport Authorize Function Group for a table

    Hi, Expert, I created a customize table ZF304 with Authorization Group ZFIG in development environment.   Somehow, the ZFIG did not transprot to QA.  The Authorization Group  for table ZF034 in QA show: &NC& I  need retransport the ZF304 table with Z