简体   繁体   中英

How to Create a ORACLE Table to store Appointment Time

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

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM