Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
BUG: Padding a Binary use Space
Message
De
01/12/2004 13:12:14
 
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Visual FoxPro Beta
Versions des environnements
Visual FoxPro:
VFP 9
Divers
Thread ID:
00966085
Message ID:
00966143
Vues:
7
>What do you mean?
>>
>>And if you project this into a VARCHAR() index search context ?.

I READ ON DOC:

Index keys based on Varbinary fields or expressions are padded with zeros from the right of the value to the maximum length of the field. For example, the values 0hAA, 0hAA00, and 0hAA000 have the same index key of 0hAA0000.


then PADR(binary,N) cannot to be used for search into a binary key index,
and within a SQL SELECT in general.
CREATE CURSOR BINARYINDEX (F1 Q(10),F2 Q(2))
INSERT INTO BINARYINDEX VALUES (0h01,0h01)
INSERT INTO BINARYINDEX VALUES (0h01,0h0100)
* create un binary index
INDEX ON F1+F2 TAG btag

SELECT * FROM BINARYINDEX  WHERE F1=PADR(0h01,3) AND F2=PADR(0h01,2)

SELECT * FROM BINARYINDEX  WHERE F1==0h01 AND F2==0h0100

SELECT * FROM BINARYINDEX  WHERE F1+F2==PADR(0h0101,12)

SELECT * FROM BINARYINDEX  WHERE F1+F2==PADR(0h0101,12,0h00)
With implicit left to right varbinary <=> varchar conversions
this can to be a trouble;
or is this the cause of VFPT choice for this pad() behaviour ?

A clarification would be useful.

Fabio
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform