Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Help with Indexes

Status
Not open for further replies.

ghaleon

IS-IT--Management
Jul 22, 2006
20
0
0
US
Can someone please tell me what I am doing wrong here??

EXECUTED IN PERVASIVE 9.5
CREATE TABLE "CHARACTERS" using 'wccuser2.dat'(
"userid" VARCHAR(30),
"username" VARCHAR(30),
"unsignedbinary" UINTEGER
);
CREATE UNIQUE NOT MODIFIABLE INDEX "key0" ON "CHARACTERS"("userid");
CREATE INDEX "key1" ON "CHARACTERS"("username");
CREATE INDEX "key2" ON "CHARACTERS"("unsignedbinary");
SELECT X$Index.* from X$Index WHERE Xi$file in (SELECT Xf$Id FROM X$File WHERE Xf$Name = 'CHARACTERS')

Result
<<<<<<<<<<<<<<<<<<<<<<<<
CREATE TABLE "CHARACTERS" using 'wccuser2.dat'(
"userid" VARCHAR(30),
"username" VARCHAR(30),
"unsignedbinary" UINTEGER
)
SQL statement(script) has executed successfully.
0 rows were affected.
>>>>>>>>>>>>>>>>>>>>>>>>

<<<<<<<<<<<<<<<<<<<<<<<<
CREATE UNIQUE NOT MODIFIABLE INDEX "key0" ON "CHARACTERS"("userid")
SQL statement(script) has executed successfully.
0 rows were affected.
>>>>>>>>>>>>>>>>>>>>>>>>

<<<<<<<<<<<<<<<<<<<<<<<<
CREATE INDEX "key1" ON "CHARACTERS"("username")
SQL statement(script) has executed successfully.
0 rows were affected.
>>>>>>>>>>>>>>>>>>>>>>>>

<<<<<<<<<<<<<<<<<<<<<<<<
CREATE INDEX "key2" ON "CHARACTERS"("unsignedbinary")
SQL statement(script) has executed successfully.
0 rows were affected.
>>>>>>>>>>>>>>>>>>>>>>>>

<<<<<<<<<<<<<<<<<<<<<<<<
Xi$File Xi$Field Xi$Number Xi$Part Xi$Flags
======= ======== ========= ======= ========
24 275 3 0 384
24 276 4 0 387
24 277 5 0 387

3 rows were affected.

>>>>>>>>>>>>>>>>>>>>>>>>

For some reason its putting my new indexes in index 3, 4 and 5 instead of index 0, 1 and 2.

Here is what I get when I run CheckDB.

===============================================
Problems Detected with Database Definitions
===============================================
+++++++++++++++++++++++++++++++++++++++++++++++
Table Name = CHARACTERS

The Data File Index is Not Defined in the Dictionary.
The data file defines index 0 seg 0
The dictionary does not.
The Data File Index is Not Defined in the Dictionary.
The data file defines index 1 seg 0
The dictionary does not.
The Data File Index is Not Defined in the Dictionary.
The data file defines index 2 seg 0
The dictionary does not.


===============================================

Any assistance would be much appreciated I'm racking my brain here.
 
CORRECTION
CREATE UNIQUE NOT MODIFIABLE INDEX "key0" IN DICTIONARY ON "CHARACTERS"("userid");
CREATE INDEX "key1" IN DICTIONARY ON "CHARACTERS"("username");
CREATE INDEX "key2" IN DICTIONARY ON "CHARACTERS"("unsignedbinary");

Same results.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top