Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- ALTER TABLE ADD TMP_FIELDTOFIX SAMEDATATYPE NEWDEFAULTVALUE [NOT NULL, etc.];
- UPDATE RDB$RELATION_FIELDS
- SET RDB$DEFAULT_VALUE =
- (
- SELECT Q1.RDB$DEFAULT_VALUE
- FROM RDB$RELATION_FIELDS Q1
- WHERE (Q1.RDB$RELATION_NAME = 'TABLENAME') AND
- (Q1.RDB$FIELD_NAME = 'TMP_FIELDTOFIX')
- ),
- RDB$DEFAULT_SOURCE =
- (
- SELECT Q2.RDB$DEFAULT_SOURCE
- FROM RDB$RELATION_FIELDS Q2
- WHERE (Q2.RDB$RELATION_NAME = 'TABLENAME') AND
- (Q2.RDB$FIELD_NAME = 'TMP_FIELDTOFIX')
- )
- WHERE (RDB$RELATION_NAME = 'TABLENAME') AND
- (RDB$FIELD_NAME = 'FIELDTOFIX')
- ;
- -- ALTER TABLE DROP TMP_FIELDTOFIX;
Add Comment
Please, Sign In to add comment