【问题标题】:Oracle SQL Developer flag my working views as brokenOracle SQL Developer 将我的工作视图标记为损坏
【发布时间】:2020-10-28 23:54:35
【问题描述】:

谁能告诉我为什么我的 Oracle SQL Developer 在实际工作时将我的视图标记为损坏?

不只是 1 个视图,而是 10 个视图有相同的问题,它们都是在不同的时间创建的,带有子查询或连接到多个表,并且始终可以正常工作。

提前致谢!

【问题讨论】:

    标签: sql oracle view oracle-sqldeveloper


    【解决方案1】:

    视图可能因引用对象的更改而失效。与存储的 PL/SQL 一样,下次使用时会发生重新编译,此时它将再次变为有效。例如:

    SQL> create table demo (id integer);
    
    Table created
    
    
    SQL> create or replace view v1 as select id from demo;
    
    View created
    
    
    SQL> select o.status from user_objects o where object_type = 'VIEW' and object_name = 'V1';
    
    STATUS
    -------
    VALID
    
    SQL> alter table demo modify id varchar2(10);
    
    Table altered
    
    
    SQL> select o.status from user_objects o where object_type = 'VIEW' and object_name = 'V1';
    
    STATUS
    -------
    INVALID
    
    SQL> select * from v1;
    
    ID
    ----------
    SQL> select o.status from user_objects o where object_type = 'VIEW' and object_name = 'V1';
    
    STATUS
    -------
    VALID
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2013-06-12
      • 1970-01-01
      • 2015-09-16
      • 2011-12-30
      • 1970-01-01
      • 2019-11-07
      相关资源
      最近更新 更多