1.11M Members

Data type time in oracle sql

 
0
 

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.

 
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
 
0
 

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

You
This article has been dead for over six months: Start a new discussion instead
Post:
Start New Discussion
View similar articles that have also been tagged: