Subject | Re: [Firebird-Architect] DDL, Scripts, DFW, and Commit |
---|---|
Author | Daniel Rail |
Post date | 2004-05-08T11:04:39Z |
Hello Arno,
Thursday, April 29, 2004, 3:55:26 AM, you wrote:
could see the possibility of adding to FB's DDL new options to change
a NOT NULL field to NULL, since that shouldn't cause any damage to the
data. But, giving the possibility to change a NULLable field to NOT
NULL, might require more options.
Here's an example of what it could be:
ALTER [COLUMN] <column name> NOT NULL REPLACE NULL WITH
[<new value>|DEFAULT VALUE|GEN_ID(<generator name>,<increment>)]
And, <new value> could be an expression, or even an incremental value
coming from a generator. Although, the actual implementation would be
up for discussion.
This could help alleviate the support questions pertaining to changing
NULL to NOT NULL, and where the users have done it without putting a
value in the records where the field value is NULL, and subsequently
performs a backup and restore.
And, I think it shouldn't be permitted to change the field size
directly in the system tables, unless the same checks(i.e.: reduce the
field size or change the data type) are made when it is done via DDL.
--
Best regards,
Daniel Rail
Senior Software Developer
ACCRA Group Inc. (www.accra.ca)
ACCRA Med Software Inc. (www.filopto.com)
Thursday, April 29, 2004, 3:55:26 AM, you wrote:
> If every possible action is put in a nice SQL DDL statement this should beUnfortunately, it's not even part of the SQL-Standard. Although I
> good, but i think many thirth party programs use the system tables for
> actions that aren't possible at all with DDL. Changing a NOT NULL field to a
> NULLable field for example.
could see the possibility of adding to FB's DDL new options to change
a NOT NULL field to NULL, since that shouldn't cause any damage to the
data. But, giving the possibility to change a NULLable field to NOT
NULL, might require more options.
Here's an example of what it could be:
ALTER [COLUMN] <column name> NOT NULL REPLACE NULL WITH
[<new value>|DEFAULT VALUE|GEN_ID(<generator name>,<increment>)]
And, <new value> could be an expression, or even an incremental value
coming from a generator. Although, the actual implementation would be
up for discussion.
This could help alleviate the support questions pertaining to changing
NULL to NOT NULL, and where the users have done it without putting a
value in the records where the field value is NULL, and subsequently
performs a backup and restore.
And, I think it shouldn't be permitted to change the field size
directly in the system tables, unless the same checks(i.e.: reduce the
field size or change the data type) are made when it is done via DDL.
--
Best regards,
Daniel Rail
Senior Software Developer
ACCRA Group Inc. (www.accra.ca)
ACCRA Med Software Inc. (www.filopto.com)