Click here to view and discuss this page in DocCommentXchange. In the future, you will be sent there automatically.

SQL Anywhere 10.0.1 » SQL Anywhere Server - SQL Reference » Views » Consolidated views

SYSGROUPS consolidated view Next Page

SYSINDEXES consolidated view


Each row in the SYSINDEXES view describes one index in the database. As an alternative to this view, you could also use the SYSIDX and SYSIDXCOL system views.

The tables and columns that make up this view are provided in the SQL statement below. To learn more about a particular table or column, use the links provided beneath the view definition.

ALTER VIEW "SYS"."SYSINDEXES"( icreator,
  iname,fname,creator,tname,indextype,
  colnames,interval,level_num) 
  as select up.user_name,idx.index_name,
    file.file_name,up.user_name,
    tab.table_name,
    if idx."unique" = 'N' then 'Non-unique' else
      if idx."unique" = 'U' then 'UNIQUE constraint' 
      else 'Unique' endif
    endif,
    (select list(string(c.column_name,
      if ixc."order" = 'A' then ' ASC' else ' DESC' endif) 
       order by ixc.table_id asc,ixc.index_id asc,ixc.sequence asc) 
      from SYS.ISYSIDXCOL as ixc join SYS.ISYSTABCOL as c on(
      c.table_id = ixc.table_id and
      c.column_id = ixc.column_id) where
      ixc.index_id = idx.index_id and
      ixc.table_id = idx.table_id), 0,0 from
    SYS.SYSTABLE as tab key join
    SYS.SYSFILE as file key join
    SYS.SYSINDEX as idx join
    SYS.SYSUSERPERM as up on up.user_id = idx.creator
See also