-->
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.  [ 2 posts ] 
Author Message
 Post subject: Need help with using TO_DATE function of SQL while Inserting
PostPosted: Thu Apr 20, 2006 3:49 am 
Beginner
Beginner

Joined: Thu Apr 20, 2006 3:44 am
Posts: 32
Hi I am trying to implement following SQL query using Hibernate, HQL....but not sure how to handle to_date and to_char function of SQL

INSERT INTO PWDTABLE(DATEPWDCHANGED) VALUES(TO_DATE(TO_CHAR(SYSDATE,'MM/DD/YYYY HH:MI:SS PM'),'MM/DD/YYYY HH:MI:SS PM'));

Basically I am looking at some HQL implementaion of this

Thanks and Regards

Sudhir


Top
 Profile  
 
 Post subject:
PostPosted: Thu Apr 20, 2006 5:57 pm 
Expert
Expert

Joined: Thu Dec 23, 2004 9:08 pm
Posts: 2008
The normal way to do that sort of thing is to use UserTypes, and do all the conversion in java. If you want to use your DBMS' specific functions, you could use the <sql-insert> element in the relevant class. See section 16.4 of the ref docs.


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

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.