Query user_objects for invalid view : USER_OBJECTS « System Tables Views « Oracle PL / SQL






Query user_objects for invalid view

    
SQL>
SQL> set heading off
SQL> set feedback off
SQL> set linesize 80
SQL>
SQL> select 'alter view "' || object_name || '" compile;'
  2    from user_objects
  3   where object_type = 'VIEW'
  4     and status = 'INVALID'
  5  /

alter view "EMP_PUBLIC_DATA" compile;
alter view "VIEW_T" compile;
alter view "DEPT_EMP_VIEW" compile;
alter view "DEPARTMENT_10" compile;
SQL> spool off
not spooling currently
SQL> set heading on
SQL> set feedback on
SQL>
SQL> select 'show errors view ' || object_name
  2    from user_objects
  3   where object_type = 'VIEW'
  4     and status = 'INVALID'
  5  /

'SHOWERRORSVIEW'||OBJECT_NAME
--------------------------------------------------------------------------------
show errors view EMP_PUBLIC_DATA
show errors view VIEW_T
show errors view DEPT_EMP_VIEW
show errors view DEPARTMENT_10

4 rows selected.

SQL>
SQL>

   
    
    
  








Related examples in the same category

1.Query user_objects table
2.Query USER_OBJECTS table by object name
3.Query object_type, object_name from user_objects
4.Query user_objects table for all procedure
5.list all stored procedures: 'PROCEDURE', 'FUNCTION', 'PACKAGE', 'PACKAGE BODY'
6.Query user_objects in PL/SQL
7.Query a view in user_objects table for a view just created
8.Query user_objects for invalid package body
9.Query user-objects for stored procedure
10.Query user_objects for trigger
11.Query all INVALID objects from user_objects table
12.Get code for all procedure, function and package from user_objects
13.Query user_objects table for stored procedure before and after recompile
14.If procedure is valid
15.A procedure with dependencies
16.Check package status
17.Check new created tables in user_objects
18.Finding, Validating, and Describing Packages
19.Get object id for created table
20.Show the procedure is marked invalid **
21.Show the status of a procedure
22.To find out what procedures and functions you have created, use the following SQL query: