Friday, March 11, 2011

Unique NULLs and Concat NULLs

Two new configuration options, SQL UNIQUE NULLS and SQL CONCAT NULLS, in EffiProz 1.6 can be used to control how EffiProz treat NULL values in unique constrain evaluations and in string concatenation operation.
Following example shows how SQL UNIQUE NULLS works,
create table uqtest(col1 int, col2 int, unique(col1,col2));

SET DATABASE SQL UNIQUE NULLS TRUE;
insert into uqtest values(1,null);
insert into uqtest values(1,null);
delete from uqtest;

SET DATABASE SQL UNIQUE NULLS FALSE;

insert into uqtest values(1,null);
/*ERROR*/insert into uqtest values(1,null);


Following example shows how SQL CONCAT NULLS works,
SET DATABASE SQL CONCAT NULLS TRUE;
/*result NULL*/select 'efz' ||convert( null,varchar(100));

SET DATABASE SQL CONCAT NULLS FALSE;
/*result efz*/select 'efz' || convert( null,varchar(100));

No comments:

Post a Comment