Subject | Re: [firebird-support] How to alter the check constraint of a domain definition? |
---|---|
Author | Martijn Tonies |
Post date | 2013-01-11T10:14:20Z |
Hello Michael,
ALTER DOMAIN domainname ADD CONSTRAINT CHECK (...);
Or use a GUI tool like Database Workbench that does this for you. ;)
With regards,
Martijn Tonies
Upscene Productions
http://www.upscene.com
Download Database Workbench for Oracle, MS SQL Server, Sybase SQL
Anywhere, MySQL, InterBase, NexusDB and Firebird!
> I've got a little problem that i hope to be able to solve withoutALTER DOMAIN domainname DROP CONSTRAINT;
> dropping and reacreating all columns that depend on a buggy domain
> definition.
>
> I have a database where the following domain is defined:
> CREATE DOMAIN MY_ENUM
> AS char(1) CHARACTER SET ASCII NOT NULL
> CHECK (value>'A' and value<'Z')
> COLLATE ASCII;
>
> Well, the problem is that the constraint should in fact be "CHECK
> (value>='A' and value<='Z')".
>
> Is there a way to alter this check constraint? Maybe by updating some
> system table?
>
> The documentation only says how to rename a domain or how to change the
> default value.
ALTER DOMAIN domainname ADD CONSTRAINT CHECK (...);
Or use a GUI tool like Database Workbench that does this for you. ;)
With regards,
Martijn Tonies
Upscene Productions
http://www.upscene.com
Download Database Workbench for Oracle, MS SQL Server, Sybase SQL
Anywhere, MySQL, InterBase, NexusDB and Firebird!