简体   繁体   English

SQL无效的ALTER TABLE选项

[英]SQL Invalid ALTER TABLE option

With the following SQL statement: 使用以下SQL语句:

ALTER TABLE USERS
    ADD LAST_LOGIN DATETIME() 

I am receiving the error below: 我收到以下错误:

Error report -
SQL Error: ORA-01735: invalid ALTER TABLE option
01735. 00000 -  "invalid ALTER TABLE option"
*Cause:    
*Action:

I cannot for the life of me understand why SQLDeveloper does not like the fromatting of my rather simple alter table command. 我不能为我的生活理解为什么SQLDeveloper不喜欢我相当简单的alter table命令的结果。

DATETIME is not a valid column data type. DATETIME不是有效的列数据类型。 If you're trying to add a default value, you need to specify a DEFAULT . 如果您尝试添加默认值,则需要指定DEFAULT

If you are trying to use a date format, please use one of the datetime or interval data types . 如果您尝试使用日期格式,请使用日期时间或间隔数据类型之一 If you need to store date and time, the standard DATE format stores year, month, day, hour, minutes, and seconds. 如果您需要存储日期和时间,标准DATE格式存储年,月,日,小时,分钟和秒。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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