Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Select SQL getting wrong fieldtype...
Message
 
À
06/11/2001 20:18:53
Peter Brama
West Pointe Enterprises
Detroit, Michigan, États-Unis
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Divers
Thread ID:
00578319
Message ID:
00578320
Vues:
19
The problem is probably that when selecting into a cursor like you are, it chooses the field length by the first record it encounters.
It is therefore likely that the first qty it comes across is a single digit and hence it is setting the width to 1.
However chooseing the wrong field type im not sure on, maybe it is just reporting it wrongly..
If it is a character field you can do PADL(Qty, 8) AS ... To force it to be 8 characters, if it is a numeric, I think you have to do a TRANSFORM on it, and give it the same structure as your field.
TRANSFORM(Qty, "#########")

>I have a SELECT SQL statement as follows:
>
>vTempStr="sku as fSkuOur,desc as fDesc,price as fPrice,vend_id as fSkuVend,"+ ;
>           "qty as fQtyIn,recno() as fRecno,'' as fPrnQty,price as fPrnPrice "+ ;
>           "from product into cursor cTemp "
>select &vTempStr
>
>
>Everything appears to be working fine except for something I stumbled on by accident today....
>
>The PRODUCT.QTY field is a numeric
>
>the CTEMP.FQTYIN field is being set as character length 1
>
>Not sure why or how this is happening, and in most cases it is working fine EXCEPT when I have qty amounts larger than 9 (1 single digit)... then of course the extra digits are being dropped.
>
>I need to figure out why, and how to correct it... I need those larger figures.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform