Welcome To The Home Of The Visual FoxPro Experts  
home. signup. forum. archives. search. google. articles. downloads. faq. members. weblogs. sponsors. rss.
 From: Cetin Basoz
  Where is Cetin Basoz?
 Izmir
 Turkey
 Cetin Basoz
 To: chaim dudi
  Where is chaim dudi?
 Jerusalem
 South Carolina - Israel
 chaim dudi
 Tags
Subject: RE: Error building key for index...
Thread ID: 232569 Message ID: 232574 # Views: 32 # Ratings: 2
Version: Visual FoxPro 9 SP2 Category: Databases, Tables and SQL Server
Date: Wednesday, June 24, 2009 1:56:14 PM         
   


> Hi
>
> Help Please,
>
> I have the following index:
>
> ALLTRIM(TTOC(sdatetime)+ALLTRIM(phone)+ALLTRIM(STR(id1))+ALLTRIM(STR(id2)))
>
> When I try to populate the table (alias), I get error message:"Error building key for index..."
>
> Tnx

Chaim,
You have alltrim() in your index expression which is useless for indexes and make a non-fixed size index. If alltrim is a must:

cast( ALLTRIM(TTOC(sdatetime)+ALLTRIM(phone)+ALLTRIM(STR(id1))+ALLTRIM(STR(id2))) as c(50))


to fix the size. Now to your key. It looks very weird and useless to me (I may be wrong). I don't have an idea why would you need such a combined index for but considering you have a reason can't you build something more appropriate like:

TTOC(sdatetime,1)+phone+STR(id1)+STR(id2)


Cetin Basoz

.Net has got better.Think about moving - check my blog:
Blog (main)
Blog (mirror)



COMPLETE THREAD
Error building key for index... Posted by chaim dudi @ 6/24/2009 1:46:45 PM
RE: Error building key for index... Posted by Cetin Basoz @ 6/24/2009 1:56:14 PM
RE: Error building key for index... Posted by chaim dudi @ 6/24/2009 2:32:04 PM
RE: Error building key for index... Posted by Ammar Hadi @ 6/24/2009 2:03:48 PM
RE: Error building key for index... Posted by Anders Altberg @ 6/24/2009 3:06:47 PM
RE: Error building key for index... Posted by chaim dudi @ 6/24/2009 3:32:21 PM
RE: Error building key for index... Posted by Anders Altberg @ 6/24/2009 6:53:36 PM
RE: Error building key for index... Posted by tushar @ 6/24/2009 7:02:27 PM