Oracle Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsDatabasesOracle Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
Be the architects of evolution and help create the mobile internet future. It’s your move---enter to win here!
  #1  
Old February 3rd, 2005, 10:06 AM
illig illig is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: May 2004
Location: NYC
Posts: 23 illig User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 5 h 58 m 37 sec
Reputation Power: 0
Send a message via AIM to illig
is a less precise date format (no hour/min/sec) possible?

My app needs to store some data once per day, and only once per day... I currently have a table with a normal Date type column, and a constraint that limits inserts to one per specific day.

Is it possible to set up a less precise data type (i.e. drop the hour/min/sec information from the date)? I'd like to get rid of the constraint since I don't have full administrative privileges to the deployment database (only the testing one) and I need to rely on the kindness of strangers to run the constraint creation statement for me...

Simply, I'd like to store a date as ONLY Month/Day/Year... no pesky Hours/Minutes/Seconds...

Any ideas?

<small edit>
My testing db is Oracle 9i Release 9.2.0.1.0
My deployment db is Oracle 10g Release 10.1.0.3.0

Reply With Quote
  #2  
Old February 7th, 2005, 09:46 AM
jim mcnamara jim mcnamara is offline
......@.........
Dev Shed Beginner (1000 - 1499 posts)
 
Join Date: Jun 2004
Posts: 1,307 jim mcnamara User rank is Sergeant Major (2000 - 5000 Reputation Level)jim mcnamara User rank is Sergeant Major (2000 - 5000 Reputation Level)jim mcnamara User rank is Sergeant Major (2000 - 5000 Reputation Level)jim mcnamara User rank is Sergeant Major (2000 - 5000 Reputation Level)jim mcnamara User rank is Sergeant Major (2000 - 5000 Reputation Level)jim mcnamara User rank is Sergeant Major (2000 - 5000 Reputation Level) 
Time spent in forums: 1 Week 3 Days 4 h 28 m 57 sec
Reputation Power: 48
Insert trunc(SYSDATE) or whatever date variable you're using for a timestamp.

This sounds a lot more like a schema issue - you should create a DDL script to drop the constraint. The script goes along with your code and is part of the install of your code.

Times and or dates are stored as an octaword - a 16 byte integer - called DATE datatypes.

Not using a DATE datatype on a timestamp is a not-so-great idea. VARCHAR2 data for dates doesn't sort well unless you use 'YYYYMMDD'. I don't know your design, but chances are you will run into needing a simple way to get certain dates from the table.
Every instance of using VARCHAR2 or some other datatype for dates - that I have seen - has caused more problems than it ever fixed.

Reply With Quote
Reply

Viewing: Dev Shed ForumsDatabasesOracle Development > is a less precise date format (no hour/min/sec) possible?


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 1 hosted by Hostway