SYSINDEXES 视图的每一行都描述数据库中的一个索引。您可以使用 SYSIDX 和 SYSIDXCOL 系统视图替代该视图。
在以下的 SQL 语句中提供了组成该视图的表和列。要了解有关特定表或列的详细信息,请使用该视图定义下所提供的链接。
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 'Unique' 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; |
Copyright © 2009, iAnywhere Solutions, Inc. - SQL Anywhere 11.0.1 |