This week's book giveaway is in the Clojure forum.
We're giving away four copies of Clojure in Action and have Amit Rathore and Francis Avila on-line!
See this thread for details.
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

SQL to retrieve date vals from ORA-DB

 
Rao Nadella
Greenhorn
Posts: 16
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello Friends,
I am trying to retrieve info from the Oracle DB, with a SQL statement which looks something like:
Select * from tblORA
where tblDate = ('myDate','MMDDYYYY')
Can myDate be of type String? I am trying to retrieve a date
of String type from another page and insert that date into
the SQL statement.
What would be a good way so that the Date that I retrieve from
a previous page is of correct type and be included in the SQL statement.
Thanks a bunch
-Rao
 
prabhatis
Greenhorn
Posts: 18
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
u do something like this :
String sDate = "TO_DATE('"+myDate+"','DD.MM.YYYY')";
now Query= "select * from tablename where datecol="+sDate;
hope it will help lemme know
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic