Subject Re: [Firebird-general] Re: Suggestion for enhancement
Author Daniel Rail
Hi,

At July 29, 2004, 20:42, GrumpyRain wrote:

> I have investigated Martijn's suggestion, and I believe this would
> work. Disclaimer: I haven't tried it.

> -- Flag Field as a NOT NULL Field

> UPDATE RDB$RELATION_FIELDS
> SET RDB$NULL_FLAG = 1
> WHERE RDB$RELATIONNAME = [Table Name]
> AND RDB$FIELD_NAME = [Field Name]

> -- Make sure no value in field is null

> UPDATE [Table Name]
> SET [FieldName] = [Default Value]
> WHERE [FieldName] IS NULL

This will work, as long as you perform the second step before
attempting to perform a backup and restore. Otherwise, your backup
will have a good chance of not being restorable, because of NULL
values in the field.

But, if you are simply setting RDB$NULL_FLAG=0(or NULL), then it might
be safe. As long as it is not the primary key. And, the second step
you have above doesn't have to be performed.

And, you should also look at the system table RDB$FIELDS, since that
table also contains field definitions via user-defined domains and
system domains(which each field would have, unless you explicitly
specify one when adding the field to the table).

--
Best regards,
Daniel Rail
Senior System Engineer
ACCRA Group Inc. (www.accra.ca)
ACCRA Med Software Inc. (www.filopto.com)