This week's book giveaway is in the Jython/Python forum.
We're giving away four copies of Hands On Software Engineering with Python and have Brian Allbey on-line!
See this thread for details.
Win a copy of Hands On Software Engineering with Python this week in the Jython/Python forum!
  • 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Bear Bibeault
  • Knute Snortum
  • Liutauras Vilda
Sheriffs:
  • Tim Cooke
  • Devaka Cooray
  • Paul Clapham
Saloon Keepers:
  • Tim Moores
  • Frits Walraven
  • Ron McLeod
  • Ganesh Patekar
  • salvin francis
Bartenders:
  • Tim Holloway
  • Carey Brown
  • Stephan van Hulst

problem retrieving datetime  RSS feed

 
Greenhorn
Posts: 28
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi

how to retrieve datetime with result;
if i use rs.getDate("CREATE_DATE") i am getting numberformat exception?i am using oracle database?
i want in this format 12-Jul-2003 14:20 format???
can anybody give me code
SELECT TO_CHAR(CREATE_DATE, 'DD-MON-YYYY HH24:MI') AS CREATE_DATE FROM COMPLAINT_DETAILS A,COMPLAINT_MASTER B, OFFICE_HIRARCHY C,CONSUMER_MASTER D,USER_MASTER E WHERE RECORD_STATUS='ACTIVE'
 
Ranch Hand
Posts: 925
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
replace "TO_CHAR(CREATE_DATE, 'DD-MON-YYYY HH24:MI') AS CREATE_DATE " with "CREATE_DATE"
 
Ranch Hand
Posts: 98
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Another option would be to use rs.getString("CREATE_DATE") instead of rs.getDate("CREATE_DATE"), as the TO_CHAR function probably returns a String.
-Paulo
[ July 25, 2003: Message edited by: Paulo Salgado ]
[ July 25, 2003: Message edited by: Paulo Salgado ]
 
girl power ... turns out to be about a hundred watts. But they seriuosly don't like being connected to the grid. Tiny ad:
RavenDB is an Open Source NoSQL Database that’s fully transactional (ACID) across your database
https://coderanch.com/t/704633/RavenDB-Open-Source-NoSQL-Database
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!