Посмотреть индексы в базе — различия между версиями
Материал из wiki.standart-n.ru
Aleksnick (обсуждение | вклад) (Новая страница: «Процедура <pre> SET TERM ^ ; create or alter procedure PR_GET_COUNT_TABLE_RECORDS returns ( TABLE_NAME DM_TEXT, NAME DM_TEXT, INACTIVE_STATU…») |
Aleksnick (обсуждение | вклад) |
||
(не показана одна промежуточная версия этого же участника) | |||
Строка 3: | Строка 3: | ||
SET TERM ^ ; | SET TERM ^ ; | ||
− | create or alter procedure | + | create or alter procedure PR_GET_INDICES_LIST |
returns ( | returns ( | ||
TABLE_NAME DM_TEXT, | TABLE_NAME DM_TEXT, | ||
Строка 18: | Строка 18: | ||
and R.RDB$RELATION_NAME not starting with 'MON$' | and R.RDB$RELATION_NAME not starting with 'MON$' | ||
order by R.RDB$RELATION_NAME asc | order by R.RDB$RELATION_NAME asc | ||
− | into : | + | into :TABLE_NAME |
do | do | ||
begin | begin | ||
for select I.RDB$INDEX_NAME, | for select I.RDB$INDEX_NAME, | ||
+ | I.RDB$UNIQUE_FLAG, | ||
I.RDB$INDEX_INACTIVE | I.RDB$INDEX_INACTIVE | ||
from RDB$INDICES I | from RDB$INDICES I | ||
where 1 = 1 | where 1 = 1 | ||
− | and I.RDB$RELATION_NAME = : | + | and I.RDB$RELATION_NAME = :TABLE_NAME |
order by I.RDB$INDEX_NAME asc | order by I.RDB$INDEX_NAME asc | ||
into :NAME, | into :NAME, | ||
− | : | + | :UNIQUE_STATUS, |
+ | :INACTIVE_STATUS | ||
do | do | ||
suspend; | suspend; | ||
Строка 39: | Строка 41: | ||
/* Existing privileges on this procedure */ | /* Existing privileges on this procedure */ | ||
− | GRANT EXECUTE ON PROCEDURE | + | GRANT EXECUTE ON PROCEDURE PR_GET_INDICES_LIST TO SYSDBA; |
</pre> | </pre> |
Текущая версия на 18:00, 18 мая 2016
Процедура
SET TERM ^ ; create or alter procedure PR_GET_INDICES_LIST returns ( TABLE_NAME DM_TEXT, NAME DM_TEXT, INACTIVE_STATUS DM_ID_NULL) as begin for select R.RDB$RELATION_NAME from RDB$RELATIONS R where 1 = 1 and R.RDB$RELATION_NAME not starting with 'VW_' and R.RDB$RELATION_NAME not starting with 'RDB$' and R.RDB$RELATION_NAME not starting with 'MON$' order by R.RDB$RELATION_NAME asc into :TABLE_NAME do begin for select I.RDB$INDEX_NAME, I.RDB$UNIQUE_FLAG, I.RDB$INDEX_INACTIVE from RDB$INDICES I where 1 = 1 and I.RDB$RELATION_NAME = :TABLE_NAME order by I.RDB$INDEX_NAME asc into :NAME, :UNIQUE_STATUS, :INACTIVE_STATUS do suspend; end end^ SET TERM ; ^ /* Existing privileges on this procedure */ GRANT EXECUTE ON PROCEDURE PR_GET_INDICES_LIST TO SYSDBA;