如何从视图中删除列
我正在尝试从视图中删除列,但似乎无法执行此操作,因为显然缺少关键字.有人可以告诉我我想念什么吗?
I'm trying to delete a column from a view but can't seem to be able to do it because apparently is missing a keyword. Can someone tell me what I'm missing?
ALTER VIEW REORDERINFO DROP COLUMN name;
再次尝试后,我得到了以下信息:
After trying again I got the following:
SQL> ALTER VIEW REORDERINFO
AS SELECT isbn,title, phone
FROM books JOIN publisher USING (pubid);
第2行出现错误:ORA-00922:选项丢失或无效
ERROR at line 2: ORA-00922: missing or invalid option
您不能使用ALTER VIEW
删除列.要重新创建没有该列的视图,请使用CREATE OR REPLACE VIEW
.
You cannot use ALTER VIEW
for removing a column. To recreate the view without the column, use CREATE OR REPLACE VIEW
.
从 Oracle文档:
使用
ALTER VIEW
语句显式重新编译无效的视图或 修改视图约束.
Use the
ALTER VIEW
statement to explicitly recompile a view that is invalid or to modify view constraints.
来源:Oracle®数据库
SQL语言参考
11g第2版(11.2)
E26088-01
Source: Oracle® Database
SQL Language Reference
11g Release 2 (11.2)
E26088-01