Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Nulls into cursors
Message
 
 
To
01/09/2010 09:36:56
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 9 SP2
Miscellaneous
Thread ID:
01479558
Message ID:
01479559
Views:
100
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
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform