Hi Andrus,
Maybe I do not exactly understand what do you want to do.. but...
create cursor test (c1 char null)
select c1 as c2 from test into cursor test1 readwrite
replace c2 with null in test1
It works.... if parent field accept null - then query cusror field will accept null.
Is it necessary to use SELECT '' as c2 ? or FROM cursor field does not accept null?
otherwise.. possible to select character field which accept null and replace with space(0)
Or another way
Create cursor Template (c1 char null)
Select table1.field, template.c1 as c2 From Table1 Left Outer Join Template On .T. Into cursor test1 Readwrite
Select test1
Append blank
replace c2 WITH .null.
That will additional column from template cursor which field accept .null.
>I create RW cursor by selecting constant expression
>I want to store NULL to the created field later
>How to force cursor field to accept null values ?
>ALTER TABLE c2 NULL cannot be used since real cursor contains some hundreds of columns need to allowed nul values and lot of rows.
>
>Code to reproduce:
>
>
CREATE CURSOR test ( c1 char NULL )
>APPEND BLANK
>
>APPEND BLANK
>SELECT '' as c2 FROM test INTO CURSOR test1 readwrite
>REPLACE c2 WITH null
>
> Observed: program error
> Field C2 does not accept null values.
>
> Expected: no error