Subject Re: [ib-support] Re: Dropping Index
Author Helen Borrie
At 02:41 AM 25-09-01 +0000, you wrote:

> > >but because I have done delete before dropping the index the index
> > >is in use and I cannot drop it. How do I get around it.
> >

I wrote:

> > Did you commit the deletes before trying to drop the index?
>
>Yes, I'm using TIBOQuery and AutoCommit on the linked transaction is
>set to true, and I'm assigning the the two statements in a procedure
>as
>
>qry.sql.text := 'delete from Table;'; <--- this is a data operation
>qry.ExecSQL;
>
>qry.sql.text := 'drop index Table_Index;'; <-- this is a metadata operation
>qry.ExecSQL;

OK. TIBOQuery is a dataset so it has a whole lot of dependencies during its "active" life. Hence, while you have it involved in your transaction (which will be the case with the single, self-restarting embedded transaction in TIBODatabase) the underlying table will be "busy" as soon as you call ExecSQL.

Seriously consider whether you want to have an end-user application doing metadata changes. 254 changes on any single metadata object will make your database unusable until you run a gbak and restore...

Please repost the original question in the IBO list if you really want to implement a solution to this. Make sure you indicate which versions of everything (database, Delphi, IBO) you are using when you do.

rgds,
Helen


All for Open and Open for All
InterBase Developer Initiative ยท http://www.interbase2000.org
_______________________________________________________