无效的数据类型

时间:2015-07-20 09:08:04

标签: sql oracle

CREATE table flight_details(
flight_id char(10),
flight_date date,
flight_time time,
flight_place varchar2(50),
tp_id char(8),
primary key (flight_id),
foreign key (tp_id) references travel_package(tp_id));

当我执行此操作时 出现此错误

flight_time time, * ERROR at line 4: ORA-00902: invalid datatype

如何解决这个问题?

2 个答案:

答案 0 :(得分:1)

timestamp代替time

CREATE table flight_details(
flight_id char(10),
flight_date date,
flight_time timestamp,
flight_place varchar2(50),
tp_id char(8),
primary key (flight_id),
foreign key (tp_id) references travel_package(tp_id));

答案 1 :(得分:0)

使用interval day(0)代替flight_time列的time数据类型。 并参考此链接https://dba.stackexchange.com/questions/42084/most-efficient-and-practical-way-to-store-time-values-hhmm-in-oracle-that-mak