Dashboard > iBATIS DataMapper > Home > Frequently Asked Questions > Why am I having problems inserting dates into Oracle?
Why am I having problems inserting dates into Oracle?
Added by Roberto Rabe, last edited by Roberto Rabe on May 24, 2005
Labels: 
(None)


If you don't want your SqlMap statements to look like this:

TO_DATE!
<update id="UpdateBook" parameterClass="Book">
    INSERT INTO BOOKS (
    BOOK_ID,
    TITLE,
    PUB_DATE
    )
    VALUES (
    #Id#,
    #Title#,
    TO_DATE(#PubDate#, 'mm/dd/yyyy')
    )
    </insert>

There is hope! Here is one email about Oracle dates on the C# list not needing to use TO_DATE:

http://www.mail-archive.com/ibatis-user-cs@incubator.apache.org/msg00154.html

To do so, specify an NLS_DATE_FORMAT in your Oracle db settings (init.ora) or configure your app to send dates in the format that your Oracle instance expects.


Site running on a free Atlassian Confluence Open Source Project License granted to OSS. Evaluate Confluence today.
Powered by Atlassian Confluence, the Enterprise Wiki. (Version: 2.5.5 Build:#811 Jul 25, 2007) - Bug/feature request - Contact Administrators