我想纠正这个错误

时间:2016-04-26 09:34:22

标签: sql oracle oracle11g

SQL> CREATE TABLE MEETING(
  2  M_DES VARCHAR(15) NOT NULL,
  3  M_SUB VARCHAR(15) NOT NULL,
  4  M_DATE_dd_mm_yyyy varchar2(15) NOT NULL,
  5  M_TIME_HH_MM varchar2(6) NOT NULL,
  6  M_DATE date generated always as (to_DATE(M_DATE_dd_mm_yyyy,'dd-mm-yyyy')),
  7  M_TIME date generated always as (to_CHAR(M_DATE_HH_MM,'HH24:MI:SS'))
  8  M_EMAIL VARCHAR(20) FOREIGN KEY REFERENCES MEMBER(M_EMAIL),
  9  A_EMAIL VARCHAR(20) FOREIGN KEY REFERENCES ADMIN(A_EMAIL)
 10  );
M_EMAIL VARCHAR(20) FOREIGN KEY REFERENCES MEMBER(M_EMAIL),
*
ERROR at line 8:
ORA-00907: missing right parenthesis

1 个答案:

答案 0 :(得分:2)

在第7行HH24:MI:SS')) 之后添加逗号,你应该没问题

 7  M_TIME date generated always as (to_CHAR(M_DATE_HH_MM,'HH24:MI:SS')) , 
                                                                        / \
                                                                         |
 8  M_EMAIL VARCHAR(20) FOREIGN KEY REFERENCES MEMBER(M_EMAIL),