Reputation: 41
I am trying to add to my current appointment table on ORACLE to store time of the appointment
ALTER TABLE APPOINTMENT
add (Timeofappointment to_date NOT NULL)
Here the code seems to be fine but the function to_date, or the way I am writing it don't seem to be working.
Any suggestion as I have not found one to be able to work online.
I want it to store time like this: 13:00
Upvotes: 1
Views: 458
Reputation: 3136
You'll have to use the DATE datatype to store the appointment time. Here's a quick sample to get you started.
create table mydate(i NUMBER, d date)
insert into mydate values(1, TO_DATE('2014-03-14 16:24','YYYY-MM-DD HH24:MI'));
SELECT * FROM mydate
You'll need to add the column to your table and use similar format. When you make appointments you definitely need to consider the date as well as time. Just time by itself will have little value.
Upvotes: 2