Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Vartype and type not interchangeable on field in table
Message
 
 
À
01/03/2011 19:17:15
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Versions des environnements
Visual FoxPro:
VFP 9 SP2
OS:
Windows 7
Network:
Windows 2008 Server
Database:
Visual FoxPro
Application:
Desktop
Divers
Thread ID:
01502308
Message ID:
01502313
Vues:
47
The TYPE() function evaluates expression passed to it not the type of the field. AFIELDS() + ASCAN() will do the trick

>I need to preprocess a table or cursor and replace all nulls with zeros for numeric fields and spaces for character, empty dates, etc.
>
>I have mytable open, it has a column - rate
>
>I put numeric data into it
>?vartype(mytable.rate) && shows N
>?type("mytable.rate") && shows N
>
>I put a null into it the data
>
>?vartype(mytable.rate) && shows X
>?type("mytable.rate") && shows N
>
>So it looks like vartype is evaluating the data type of the data in the field, whereas type is evaluating the data type of the field? In this case, what I need is the data type of the field. I guess I can rely on type for this?
>
>Ideally though I'd like to have a function like get_field_datatype(). I could create one by creating a temp table with copy structure extended and querying that table for the field's data type. I don't see though that a native function exists to do this?
--sb--
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform