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 u.user_name,idx.index_name,dbs.dbspace_name,u.user_name, tab.table_name, case idx.index_category when 1 then 'Primary Key' when 2 then 'Foreign Key' when 3 then( if idx."unique" = 4 then 'Non-unique' else if idx."unique" = 2 then 'UNIQUE constraint' else if idx."unique" = 5 then 'UNIQUE NULLS NOT DISTINCT' else 'UNIQUE' endif endif endif) when 4 then 'Text Index' end,(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.ISYSTAB as tab join SYS.ISYSDBSPACE as dbs on(tab.dbspace_id = dbs.dbspace_id) join SYS.ISYSIDX as idx on(idx.table_id = tab.table_id) join SYS.ISYSUSER as u on u.user_id = tab.creator |
Discuss this page in DocCommentXchange.
|
Copyright © 2012, iAnywhere Solutions, Inc. - SQL Anywhere 12.0.1 |