create table xyz
(
field_foo char(1) check (field_foo in 'y', 'n'),
foo_detail varchar(255),
check (
case
when field_foo='y' and foo_detail is null
then false
else true
end
)
);
A simpler check would be :
CHECK(
(field_foo = 'y' AND foo_detail IS
Hi:
> > (A)
> > I have three radio boxes in the user form
> >
> > field_foo
> > []yes
> > []no
> > []unknown
> > ...
> > field_foo char(1) not null check
> > (field_foo in 'y', 'n', 'u')
> > OR
> > field_foo char(1) check (field_foo in 'y', 'n')
> >
> Option 1 - the
On Sat, Jan 15, 2005 at 06:40:18AM -0800, j.random.programmer wrote:
> field_foo char(1) check (field_foo in 'y', 'n')
>
> The second choice always implies that NULL means
> unknown,
> whereas for the first choice, unknown is coded as 'u'.
NULL actually means "unknown". SQL uses 3-valued logic:
j.random.programmer wrote:
Hi all:
I was wondering if anyone had recommendations for the
following scenarios:
(A)
I have three radio boxes in the user form
field_foo
[]yes
[]no
[]unknown
These are mutually exclusive and user input is always
required.
So in the database, should I have someth
Hi all:
I was wondering if anyone had recommendations for the
following scenarios:
(A)
I have three radio boxes in the user form
field_foo
[]yes
[]no
[]unknown
These are mutually exclusive and user input is always
required.
So in the database, should I have something like:
field_foo ch