Check index column and contraints for just created table : user_ind_columns « System Tables Views « Oracle PL / SQL






Check index column and contraints for just created table

    
SQL>
SQL> create table movie(
  2           movie_no               integer              constraint movie_pk primary key using index (create index movie_pk_idx on movie(movie_no) )
  3          ,title                  varchar2(40)
  4          ,rating                 char(4)
  5          ,type                   varchar2(20)
  6          ,star                   varchar2(40)
  7          ,qty                    number
  8          ,price                  number
  9  );

Table created.

SQL>
SQL> select index_name, table_name, column_name from user_ind_columns where table_name = 'MOVIE';

MOVIE_PK_IDX                   MOVIE
MOVIE_NO


1 row selected.

SQL>
SQL> select constraint_name, table_name, column_name from user_cons_columns where table_name = 'MOVIE';

MOVIE_PK                       MOVIE
MOVIE_NO


1 row selected.

SQL>
SQL> drop table movie cascade constraints;

Table dropped.

   
    
    
    
  








Related examples in the same category

1.Decode column position
2.Query user_indexes and user_ind_columns table
3.user_indexes join user_ind_columns ic using (table_name,index_name)