Subject | Re: [firebird-support] Record null on default '0' |
---|---|
Author | Martijn Tonies |
Post date | 2011-05-24T12:48:01Z |
Hi,
( id integer,
no_def varchar(1),
deffed varchar(1) default '0'
)
commit
insert into default_test (id)
values (1);
no value given for both columns, defaults are used: for the
column "no_def" this means NULL, for column deffed, this
means '0'.
insert into default_test(id, deffed)
values (2, null);
presto, NULL inserted into column "deffed".
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!
> All dba firebird,create table default_test
>
> I have field varchar(1) default '0' on structure,
> But just 6 record have 'null' on 50000 record have '0'.
> Why..
( id integer,
no_def varchar(1),
deffed varchar(1) default '0'
)
commit
insert into default_test (id)
values (1);
no value given for both columns, defaults are used: for the
column "no_def" this means NULL, for column deffed, this
means '0'.
insert into default_test(id, deffed)
values (2, null);
presto, NULL inserted into column "deffed".
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!