如何在 Oracle 中更改视图的列大小 [英] How to alter column size of a view in Oracle

查看:87
本文介绍了如何在 Oracle 中更改视图的列大小的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用我们用于表的相同命令来更改视图的列大小,例如:

I am trying to alter the column size of a view with the same command that we use for table like :

alter table 
STUDENT
modify (
    ROLL_NO VARCHAR2(80)
);

但是它的抛出错误

SQL 错误:ORA-00942:表或视图不存在

SQL Error: ORA-00942: table or view does not exist

那么我们如何改变视图的列大小?

So how we can alter the column size of a view?

推荐答案

这是我遵循的程序:

1- 首先通过运行以下查询找到该视图的基表

1- First find the base table for that view by running the following query

SELECT * FROM DBA_DEPENDENCIES
WHERE OWNER = '<scheman_name>'
AND NAME = '<view_name>'
AND TYPE = 'VIEW';

2- 以上查询将为您提供一个表,您可以在其中找到列名REFERENCED_NAME"下的基表.

2- Above query will you a table where you will find the base table under the column name 'REFERENCED_NAME'.

3- 现在更改该基表的列大小.

3- Now Change the column size of that base table.

注意:视图可以由 1 个或 1 个以上的表组成,因此您需要更改所有这些基表的列大小.

这篇关于如何在 Oracle 中更改视图的列大小的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆