>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