Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Invalid key lenght
Message
De
25/02/1997 15:37:54
 
 
À
25/02/1997 14:11:33
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00021912
Message ID:
00022004
Vues:
49
>>>>I get the error 'Invalid key length' when :
>>>>
>>>>select a.ADDRESS1,a.ADDRESS2 from DONOR a group by a.ADDRESS1,a.ADDRESS2 having count(*)>1 into cursor temp
>>>>
>>>>select a.ADDRESS1 as ADDRESS1 from DONOR a ,temp b where a.ADDRESS1=b.ADDRESS1 and a.ADDRESS2=b.ADDRESS2 order by a.ADDRESS1,a.ADDRESS2 into cursor result
>>>>
>>>>I attemp to find out record with duplicate value of address1 and address2.
>>>>The error locate at the second select statment.
>>>>I have try
>>>>- reindex the donor table
>>>>- add 'where .t.' at the first select statement
>>>>but still get the error. Why?
>>>>
>>>>Info: Address1 and Address2 are character fields of length 50.
>>>>
>>>>Thanks
>>>>-Jasper
>>>
>>>Jasper: Don't you have to have an ADDRESS2 field in your second select. All the fields in your ORDER BY clause must be in your SELECT clause:
>>>
>>>
>>>select a.ADDRESS1 as ADDRESS1;
>>>a.ADDRESS2 as ADDRESS2;
>>>from DONOR a ,temp b where a.ADDRESS1=b.ADDRESS1 and a.ADDRESS2=b.ADDRESS2 order by a.ADDRESS1,a.ADDRESS2 into cursor result
>>>
>>>
>>>Note the second line.
>>>
>>>HTH
>>>Barbara
>>
>>I still get the error even :
>>
>>select a.ADDRESS1,a.ADDRESS2 from DONOR a where .t. group by a.ADDRESS1,a.ADDRESS2 having count(*)>1 into cursor temp
>>
>>select a.ADDRESS1 as ADDRESS1 ,a.ADDRESS2 as ADDRESS2 from DONOR a ,temp b where a.ADDRESS1=b.ADDRESS1 and a.ADDRESS2=b.ADDRESS2 order by a.ADDRESS1,a.ADDRESS2 into cursor result
>>
>>I don't know why????
>>Please help me .....
>
>My God! Same table, Same code, no problem in fpw2.6
>But error at vfp3.0! I am dying

What's going on inside fpw2.6? In the second Select, I use
....where alltrim(a.address1)=alltrim(b.address1) and alltrim(a.address2)=alltrim(b.address2)....
It get this error in fpw2.6. (but ok when no alltrim **both not ok in vfp3.0)

In vfp3.0, I use (alltrim(a.address1)+alltrim(a.address2))=(alltrim(b.address1)+b.address2)) will be ok, but I can't use this way, because it will not check characters fields everytime, sometime other type of fields, the select statement is generated, not hard coded.
oh, what is the fastest way to write good program?
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform