I have a column with a NOT NULL constraint:
ex) PREDIR VARCHAR2(2) NOT NULL
I have a DBGrid attached to a DataSet and when I try and enter a space character in a field, something internal treats this space as a NULL and refuses to update since it doesn't follow the constraint.
Any idea for workarounds? I don't want to store a NULL in the field and I do want a space to be a valid value in the field.
The Dataset.BeforePost event has the following code:
if DataSet.FieldByName('PREDIR').AsString = '' then DataSet.FieldByName('PREDIR').AsString := ' ';
But the space gets stripped somewhere after this code executes.
ex) PREDIR VARCHAR2(2) NOT NULL
I have a DBGrid attached to a DataSet and when I try and enter a space character in a field, something internal treats this space as a NULL and refuses to update since it doesn't follow the constraint.
Any idea for workarounds? I don't want to store a NULL in the field and I do want a space to be a valid value in the field.
The Dataset.BeforePost event has the following code:
if DataSet.FieldByName('PREDIR').AsString = '' then DataSet.FieldByName('PREDIR').AsString := ' ';
But the space gets stripped somewhere after this code executes.