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:
SlickEdit: Code in over 40 languages across 7 platforms. SlickEdit’s unmatched power, speed, and flexibility allows even the most accomplished developers to write better code faster. Download a free trial today!
  #1  
Old March 22nd, 2004, 06:49 PM
Hapax Hapax is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Mar 2004
Posts: 4 Hapax User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Data & hour

I have created a table:

CREATE TABLE SOCIS (
NOM VARCHAR2 (20),
DATA DATE,

CONSTRAINT SOCIS_PK PRIMARY KEY (NOM,DATA) );

¿DATA can contains a data and hour like 9-3-2000 11:00?
¿Or I have to create other row for the hour?

Reply With Quote
  #2  
Old March 25th, 2004, 08:51 AM
shafique shafique is offline
Senior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Sep 2003
Location: Canada
Posts: 305 shafique User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 2 h 45 m 20 sec
Reputation Power: 5
Every reference of DATE data type stores date and time information which is optional, if you dont insert the time information, oracle uses the default value 00:00:00.

time information can be stored with date as follows:

UPDATE emp
SET hiredate = to_date('17-DEC-1980 14:30:00','DD-MON-YYYY HH24:MI:SS')
WHERE empno=7369
/

and can be queried as follows:

SELECT empno,ename,to_char(hiredate,'DD-MON-YYYY HH24:MI:SS')
FROM emp
WHERE to_char(hiredate,'DD-MON-YYYY HH24:MI:SS')='17-DEC-1980 14:30:00'
/

Regards

Reply With Quote
Reply

Viewing: Dev Shed ForumsDatabasesOracle Development > Data & hour


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 2 hosted by Hostway