#SBPro question
Chas
This is a problem I have met several times before … SBase treats "null"
fields as containing a blank rather than not containing any data.
The only colution I found to the problem (and I'd be interested if Tim can
come up with a better way) is to have the data field and a calculation
field … if the data field contains data then the calc field is set to the
contents of the data field … if it doesn't, then a would generate a
pseudo reference number which was totally out of the range of the normal
data field.
I don't know the format of US social security numbers, but I will give a
numeric example:
Say you have your SSN numeric field … create another field called SSNix
(SSN index) which is a calculation field as follows:
(SSN = 0) ? SER("filename"): SSN
This will place the value of SSN in SSNix (which is your unique index
field), but if it doesn't exist, it will create a psuedo SSN as a serial
number (which, of course, will be different for every record). There are
many variants on this … you could, for instance, change SSNix into a text
field (converting SSN to a string) and prefixing the non-SSN entries with
"AAA" or whatever.
The proper handling of null entries is an important feature of how a
relational database works … an excellent article in BYTE some time back
explained the formal definition of a relational database, and this included
the proper handling of null entries.
Mike (Whapping from the UK)