We're a community of 1077K IT Pros here for help, advice, solutions, professional growth and fun. Join us!
1,076,055 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Start New Discussion Reply to this Discussion

Data type time in oracle sql

I'm trying to create a table in oracle here's the code

drop table class;

create table class
	(schedule_num		integer primary key not null, 
	 semester		varchar(10), 
	 course_name		varchar(14),
	 credit			int,
	 department		varchar(15),
	/* meeting_time		time,*/
	 meeting_place 		varchar(20),
	 enrollment_limit	int);

I don't how to initiate the 'time' data-type, can someone help. The time is as in what time something starts. Example: the meeting starts at 9:00. I need to keyword and syntax.

3
Contributors
2
Replies
22 Hours
Discussion Span
1 Year Ago
Last Updated
6
Views
rugged1529
Newbie Poster
10 posts since Oct 2011
Reputation Points: 10
Solved Threads: 0
Skill Endorsements: 0

Still use 'DATE', Date also save the time.

create table class
	(schedule_num		integer primary key not null, 
	 semester		varchar(10), 
	 course_name		varchar(14),
	 credit			int,
	 department		varchar(15),
	 meeting_time		DATE,
	 meeting_place 		varchar(20),
	 enrollment_limit	int);

Example :

select to_char(meeting_time,'HH24:MI:SS') from class
Jx_Man
Senior Poster
3,528 posts since Nov 2007
Reputation Points: 1,482
Solved Threads: 516
Skill Endorsements: 64

Also... Stick with the basic datatypes; VarChar2, Number, and Date.
It just makes things easier.

hfx642
Posting Pro
515 posts since Nov 2009
Reputation Points: 248
Solved Threads: 105
Skill Endorsements: 1

This article has been dead for over three months: Start a new discussion instead

Post: Markdown Syntax: Formatting Help
 
You
View similar articles that have also been tagged:
 
© 2013 DaniWeb® LLC
Page rendered in 0.0578 seconds using 2.63MB