-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: Oracle date mapping with .NET DateTime (update/insert)
PostPosted: Fri Jul 10, 2009 1:09 am 
Newbie

Joined: Fri Jul 10, 2009 1:05 am
Posts: 3
Hi, I've got a mapping from a .NET DateTime type to an Oracle Date type. Reading the object converts perfectly the oracle date to .Net datetime...

but I have problems with update and insert statements.

Basically, the SQL that gets generated looks like this...

update my_table
set date_column = 26/01/1998 00:00:00
where ...

Note that not even quotes are placed around the date value. This is not recognized by oracle. I'm new to oracle as well, but the only way I found out to update a date field in oracle would be something like (correct me if I'm wrong but that's what my collegues are telling, all Oracle developers):

set date_column = to_date('26/01/1998 00:00:00', 'DD/MM/yyyy HH:MI:SS')

What mapping do I need to use to obtain a correct update and insert statement with DateTime in Oracle. I'm sure there should be a simple default implementation.

I'm using NHibernate 2.1 with the Oracle10gDialect.

Thanks


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.