Click to See Complete Forum and Search --> : Inserting blank numbers in a Visual Foxpro 9.0 database.


RealDetection
June 3rd, 2009, 05:40 AM
Hello there,

We have a table in which all columns are defined as not nullable.

When opening the table in the Visual Foxpro viewer, the number columns that do not contain a number instead contain a series of spaces, equal to the width of the number.
E.g.: There's a column called 'huisnr' which is of type number and width five. If, in a row, this column doesn't contain any data, it simply contains five empty spaces (like this: ' ').

Inserting a dummy number or alter the column definitions isn't allowed. So what would the insert statement look like in order to insert a blank number?



Or is this the wrong approach and should the columns de made nullable using a query? That would allow a NULL insert. Then, the columns can be made not nullable again using another query.

I just tested this, and if I do an insert this way (making the column in question nullable, inserting null and then making the column not nullable), then the results are exactly what we're looking for: The column with the NULL insert shows a number of spaces equal to the width of the number (and not .NULL.).
It's not the cleanest way, but are there any others?