Defaults and nil (again)

I have a String-like type with default "" (empty string). Is it possible to have a column of this type with default nil, or will the type default always override it?

Seems to work

Hi Jon,

Based on my testing, this works, both in D4 directly, and when the table is accessed via a derived form:

create type TestString like String { default "" };

create table TestStringTable
ID : Integer,
TestString : TestString nil { default nil },
key { ID }

insert row { 1 ID } into TestStringTable;

select TestStringTable;

Bryn Rhodes
Database Consulting Group LLC

Not on my system

I should have been more specific: Such an insert does work correctly, but when I browse the table in the Frontend, and Add a row, the TestString TextBox is empty/blank, not nil (while the ID field is correctly nil). And thus, of course, if the TestString field is not touched, an empty string will be inserted. Does this work differently on your system, since you say it works "when the table is accessed via a derived form"?


I'm sorry, I should have tried this out-of-process. In-process it works. Unfortunately, the problem is a client-side catalog serialization issue which will require a code-change to fix. I will continue to look into this to see if I can find an alternate work-around.

Bryn Rhodes
Database Consulting Group LLC