• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

SQL to retrieve date vals from ORA-DB

 
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic