SET TERM ^ ;
EXECUTE BLOCK AS BEGIN
if (not exists(select * from RDB$INDICES where RDB$INDEX_NAME='IDX_WGHCONTOSTO_ARRIVO')) then 
execute statement 'CREATE INDEX IDX_WGHCONTOSTO_ARRIVO ON WGHCONTOSTO (ARRIVO);';
END^
EXECUTE BLOCK AS BEGIN
if (not exists(select * from RDB$INDICES where RDB$INDEX_NAME='IDX_WGHCONTOSTO_PARTENZA')) then 
execute statement 'CREATE INDEX IDX_WGHCONTOSTO_PARTENZA ON WGHCONTOSTO (PARTENZA);';
END^
EXECUTE BLOCK AS BEGIN
if (not exists(select * from RDB$INDICES where RDB$INDEX_NAME='IDX_WGHCONTOSTO_CODCLI')) then 
execute statement 'CREATE INDEX IDX_WGHCONTOSTO_CODCLI ON WGHCONTOSTO (CODCLI);';
END^
EXECUTE BLOCK AS BEGIN
if (not exists(select * from RDB$INDICES where RDB$INDEX_NAME='IDX_WGHCONTOSTO_CODDITTA')) then 
execute statement 'CREATE INDEX IDX_WGHCONTOSTO_CODDITTA ON WGHCONTOSTO (CODDITTA);';
END^
EXECUTE BLOCK AS BEGIN
if (not exists(select * from RDB$INDICES where RDB$INDEX_NAME='IDX_WGHADDSTO_CODCONTO')) then 
execute statement 'CREATE INDEX IDX_WGHADDSTO_CODCONTO ON WGHADDSTO (CODCONTO);';
END^
EXECUTE BLOCK AS BEGIN
if (not exists(select * from RDB$INDICES where RDB$INDEX_NAME='IDX_WGHADDSTO_CODADD')) then 
execute statement 'CREATE INDEX IDX_WGHADDSTO_CODADD ON WGHADDSTO (CODADD);';
END^
EXECUTE BLOCK AS BEGIN
if (not exists(select * from RDB$INDICES where RDB$INDEX_NAME='IDX_WGHADDSTO_DATA_ADD')) then 
execute statement 'CREATE INDEX IDX_WGHADDSTO_DATA_ADD ON WGHADDSTO (DATA_ADD);';
END^
COMMIT^
SET TERM ; ^