Kevin,
I know this is over two years old and I am not sure it is exactly what you were trying to do but I just had a similar need and this worked for me.
lcName='Kevin Emmrich'
select IIF(RECNO(),2,.null.,lcName) AS Name , pk from usersecurity into cursor temp READWRITE
As long as the first record's value is a datatype and a .null. value is encountered in the initial SQL SELECT the field will except .NULL. values.
>Hello,
>
>I got an error and I am trying to understand why this is a problem.
>
>For example if I run the following code
>
>
>lcName='Kevin Emmrich'
>select lcName, pk from usersecurity into cursor temp
>lcName = .NULL.
>select lcName, pk from usersecurity into cursor temp
>
>
>When I set lcName to NULL I get the error '
does not accept null values'. Why wouldn't the sql*select just create a field in temp that can accept nulls. Is the problem that the sql*select can't figure out the data type even though it is a "C"?
>
>Thanks in advance,
>
>Kevin