Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Invalid key lenght
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00021912
Message ID:
00022025
Vues:
51
>>>I'm assuming that you are looking for different records with the same address1 AND address2.
>>>
>>>Try
>>>SELECT ADDRESS1,ADDRESS2,COUNT(*) ;
>>> from DONOR;
>>> group by ADDRESS1,ADDRESS2;
>>> order by 3 DESC;
>>> into cursor temp
>>>
>>>This will give you all the Address1's and Address2's and their respective counts in the DONOR table. The order by just makes it easier to look at what kind of numbers you have.
>>>
>>>Perhaps I'm not quite understanding what you are trying to do, but your second query is really not needed. You have your duplicate addresses and how many duplicates of each pair in the cursor temp.
>>>
>>>
>
>>I need the second Select, because I need to list out the duplicated record one by one to the user.
>
>Ah...ok...
>
>Then how 'bout...
>
>SELECT {Whichever fields from DONOR you need},;
> TEMP.address1,TEMP.address2;
> From donor,temp;
> where donor.address1 = temp.address1;
> AND donor.address2 = temp.address2;
> AND temp.cnt > 1;
> into cursor result
>
>Sometimes I've found that Fox really, really, REALLY wants fields from both tables in the selection criteria.
>
>Also, is DONOR indexed on an ALLTRIM() of either fields?

Jasper: I looked up the error message, and it says that "The length of a key for a CDX index must be between 1 and 254 characters"

Dorris' question about your index is a good one - an alltrim() of an empty record could give a 0-length key.

Two things about using the trim() and alltrim() functions: First, an index key should always be a set number of characters, and a key including trim() or alltrim() will vary in length.

Second, when you use a function in a SELECT field the field length in the result-cursor is the length of the first item picked. For example, if you use trim(firstname), your field might be 3 if the first name were Jim, or 11 if the name were Christopher.

None of this is specific to your problem, but it might help.
Barbara Paltiel, Paltiel Inc.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform