Subject | Re: [firebird-support] Constraint Irregularity |
---|---|
Author | Martijn Tonies |
Post date | 2006-03-17T14:16:57Z |
Hello Jason,
Thing is, it goes against the SQL standard. Also this is a known issue.
Martijn Tonies
Database Workbench - development tool for Firebird and more!
Upscene Productions
http://www.upscene.com
My thoughts:
http://blog.upscene.com/martijn/
Database development questions? Check the forum!
http://www.databasedevelopmentforum.com
> Ok, first thing, DON'T ask me WHY I am doing this.field I had. If I declare a check constraint:
>
> Anyway, I found a peculiarity with adding a check constraint to a varchar
>real value. The problem is, trying to insert a
> Alter Table MyTable
> Add Constraint MyConstraint Check (MyField <> '');
>
> Seems simple enough. I want no empty stings in this field. Only NULL or a
> NULL into MyField will cause a constraint violation... like it, for thatmoment, can't tell the difference between a
> NULL and an empty string.Well, they ARE different.
>Now if I modify the check constraint to look like this:supplemental "or MyField is Null". Any incite
>
> Alter Table MyTable
> Add Constraint MyConstraint Check (MyField <> '' or MyField Is Null);
>
> Everything works peachy. Obviously it is unclear as to why I need the
> would be appreciated. If it turns out to be a bug, Ill file a report.No, this is known behaviour.
>
Thing is, it goes against the SQL standard. Also this is a known issue.
Martijn Tonies
Database Workbench - development tool for Firebird and more!
Upscene Productions
http://www.upscene.com
My thoughts:
http://blog.upscene.com/martijn/
Database development questions? Check the forum!
http://www.databasedevelopmentforum.com