Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Nulls into cursors
Message
 
 
À
01/09/2010 09:36:56
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Versions des environnements
Visual FoxPro:
VFP 9 SP2
Divers
Thread ID:
01479558
Message ID:
01479559
Vues:
101
This message has been marked as the solution to the initial question of the thread.
>I have a cursor created from a SELECT statement in which I would like to insert some nulls.
>
>The cursor is created by something that looks like:
Select partno,;
>      sum(Value1) as Field1,;
>      sum(Value2) as Field2,
>      into curosr SomeCursor ReadWrite
>
>So, two questions:
>(1) Can I specify (somehow) in the SELECT that I want the result field to allow nulls (even though the SELECT statement itself will not create any nulls)
>
>or (2) Can somebody specify the ALTER statement that will let me modify the cursor so that it will accepts nulls.
>
>Thanks,
>
>(More confused than normal in Newbury Park)

Yes, you can do both.

You can also use
CAST(sum(Value) as I Null) as Field1,
-- if you want to get integer field, you can use any other numeric type here

Take a look at CAST() function in Help.

BTW, in your original statement the GROUP BY is missing.
If it's not broken, fix it until it is.


My Blog
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform