954,561 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

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.

rugged1529
Newbie Poster
10 posts since Oct 2011
Reputation Points: 10
Solved Threads: 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
Nearly a Senior Poster
3,329 posts since Nov 2007
Reputation Points: 1,372
Solved Threads: 444
 

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
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You
View similar articles that have also been tagged: