response to my self, is it correct?
execute block
returns (drop_index_name varchar(31), dropped boolean) as
declare variable doit boolean;
declare variable stmt varchar(2048);
begin
dropped=false; -- test before
for
select i.rdb$index_name
from rdb$indices i
where
(i.rdb$system_flag<>1)
and (i.rdb$unique_flag<>1)
and (rdb$foreign_key is null) into :drop_index_name do
begin
stmt='drop index '||:drop_index_name||';';
if (dropped) then
execute statement :stmt;
suspend;
end
end
Em qui., 12 de mar. de 2020 às 17:59, hamacker <[email protected]>
escreveu:
>
> Is it possible to drop all indexes, except those related to PK and FK?
>
> I would like to do a test and recreate them by script.
>
>