Subject | Re: [IBO] Re: Null in Stored Procedure parameter. |
---|---|
Author | Lucas Franzen |
Post date | 2001-01-11T16:55:12Z |
Juha,
Stating that there's NO VALUE.
Following Ann H's commandments you should not regrad NULL as a value -
it's a state - Helen jumps in right now :-)
If I've got an integer field in a table than I won't assume -1 to be
undefined I would rather use NULL for this.
Otherwise I restrict myself in values.
So what if a user enters a -1 in that field?
Is it to make the value unassigned or did he really mean -1????
If you don't want to have queries like the one above (where state <> 1),
then make the field not null.
Regards
Luc.
> But using null to signal something is conceptually against thesorry, to contradict you, but that's just what NULL is for.
> principles of database design. You should use some other value, like
> -1, to mean non-existing and like. Also remember that you can't
> compare null to anything else than to null. E.g. you create a field
> "state" that can take several values: null, 1, 2 and 3. You will run
> into trouble if you make a query with "WHERE state <> 1".
Stating that there's NO VALUE.
Following Ann H's commandments you should not regrad NULL as a value -
it's a state - Helen jumps in right now :-)
If I've got an integer field in a table than I won't assume -1 to be
undefined I would rather use NULL for this.
Otherwise I restrict myself in values.
So what if a user enters a -1 in that field?
Is it to make the value unassigned or did he really mean -1????
If you don't want to have queries like the one above (where state <> 1),
then make the field not null.
Regards
Luc.