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.

Recommended Answers

All 2 Replies

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
Member Avatar for hfx642

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

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.