Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在尝试通过使用 SQL 查询向其中添加两个新列来更改 Oracle 数据库中的表,如下所示:
ALTER TABLE Members ADD annual_dues NUMBER(5,2) not null DEFAULT '52.50', ADD payment_date DATE;
在执行它时,我收到如下错误:
SQL 错误:ORA-30649:缺少 DIRECTORY 关键字
我玩过它,但没有帮助。SQL 查询有什么问题?
我认为你需要NOT NULL把DEFAULT 52.50:
NOT NULL
DEFAULT 52.50
ALTER TABLE Members ADD ( annual_dues NUMBER(5,2) DEFAULT 52.50 NOT NULL , payment_date DATE );