Subject RE: [firebird-support] Recreate indexes
Author Codebue Fabio - P-Soft
and so I can't recreate all index?
Or I have only to skyp primary key?
But If I need to recreate PK what I have to do?


fab10
.-----------------------------.
-----Original Message-----
From: firebird-support@yahoogroups.com
[mailto:firebird-support@yahoogroups.com] On Behalf Of Thomas Steinmaurer
Sent: Monday, July 14, 2008 3:14 PM
To: firebird-support@yahoogroups.com
Subject: Re: [firebird-support] Recreate indexes

Hi Fabio,

> I'm trying to build a little store procedure to rebuild my indexex
whenever
> I want...
>
> her3e you are:
>
> for select 'ALTER INDEX '||rdb$index_name ||' INACTIVE;'
> from rdb$indices
> where rdb$system_flag is null or rdb$system_flag = 0
> into :COMANDO
> do EXECUTE STATEMENT :COMANDO;
>
> /* ACTIVE Indici */
> for select 'ALTER INDEX '||rdb$index_name ||' ACTIVE;'
> from rdb$indices
> where rdb$system_flag is null or rdb$system_flag = 0
> into :COMANDO
> do EXECUTE STATEMENT :COMANDO;
>
> I suppose to identify no SYSTEM index using rdb$system_flag is null or
> rdb$system_flag = 0
> but if I run it I obtain an error who tell me:
>
> This operation is not defined for system tables.
> unsuccessful metadata update.
> MODIFY RDB$INDICES failed.
> action cancelled by trigger (3) to preserve data integrity.
> Cannot deactivate index used by a PRIMARY/UNIQUE constraint.
>
> soem idea?

You can't deactivate the underlaying index of a primary / unique constraint.


--
Best Regards,
Thomas Steinmaurer
LogManager Series - Logging/Auditing Suites supporting
InterBase, Firebird, Advantage Database, MS SQL Server and
NexusDB V2
Upscene Productions
http://www.upscene.com

------------------------------------

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Visit http://www.firebirdsql.org and click the Resources item
on the main (top) menu. Try Knowledgebase and FAQ links !

Also search the knowledgebases at http://www.ibphoenix.com

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Yahoo! Groups Links