Board index » delphi » IB can't handle duplicate index names?

IB can't handle duplicate index names?

I am getting the following error when I try to create multiple tables with
the same structure:

CREATE TABLE test1 (myint INTEGER, myblob BLOB SUB_TYPE 1);
CREATE INDEX myint_tag ON test1 (myint);

CREATE TABLE test2 (myint INTEGER, myblob BLOB SUB_TYPE 1);
CREATE INDEX myint_tag ON test2 (myint);

[InterBase]unsuccessful metadata update, STORE RDB$INDICES failed, attempt
to store duplicate value (visible to active transactions) in unique index
"RDB$INDEX_5"

If I change the second index name to this, it works:

CREATE INDEX myint_tag2 ON test2 (myint);

What's going on here?  Its no problem with MS-SQL server.  I am using
Delphi, ADO/ODBC, and Easysoft driver.

Thanks,

Dan English
Defined Systems
www.defined.net
Developer Web Hosting & Components

 

Re:IB can't handle duplicate index names?


All object names must be unique inside same schema in any RDMBS. I really
doubt that you can do on MS SQL Server unless you create the index on
another DB.

--
Sergio Samayoa
Lgica Software
http://www.geocities.com/logicasw/

Re:IB can't handle duplicate index names?


Even on a different table?  How then, can you have multiple tables with the
same structure?  I really don't get an error from MS-SQL.

-Dan

Quote
"Sergio Samayoa" <serg...@terra.com.gt> wrote in message

news:3b1bd9f0_2@dnews...
Quote
> All object names must be unique inside same schema in any RDMBS. I really
> doubt that you can do on MS SQL Server unless you create the index on
> another DB.

Re:IB can't handle duplicate index names?


Quote
Dan English wrote:

> Even on a different table?  

        Indices must be uniquely named DB-wide, regardless of which table
they're related to.

Quote
> How then, can you have multiple tables with the
> same structure?  

        Why would you care about the index name WRT table structure?

        -Craig

--
Craig Stuntz (TeamB)       Senior Developer, Vertex Systems Corp.
Delphi/InterBase weblog:   http://delphi.weblogs.com
Use Borland servers; posts via others are not seen by TeamB.
For more info, see http://www.borland.com/newsgroups/genl_faqs.html

Re:IB can't handle duplicate index names?


Sorry, I am coming from an xBase background... I suppose the index name
doesn't matter.

-Dan

Re:IB can't handle duplicate index names?


Quote
Dan English wrote:

> Sorry, I am coming from an xBase background... I suppose the index name
> doesn't matter.

        The only time I ever use the index name (outside of when I created it)
is when writing a PLAN.  And I go to lengths to never write PLANs.

        HTH,

        -Craig

--
Craig Stuntz (TeamB)       Senior Developer, Vertex Systems Corp.
Delphi/InterBase weblog:   http://delphi.weblogs.com
Use Borland servers; posts via others are not seen by TeamB.
For more info, see http://www.borland.com/newsgroups/genl_faqs.html

Other Threads