Showing results for 
Search instead for 
Did you mean: 

null or void?

Go to solution
Occasional Contributor

null or void?

Hello Dudes,

I have a doubt and I wonder if some of you may shed any light on this matter:
This is the situation:

insert into PIPPO (CLMN1,CLMN2,CLMN3)
values ('A',,'B');


insert into PIPPO (CLMN1,CLMN2,CLMN3)
values ('A','','B');

are producing the same result, in particular if the CLMN2 is defaulted with 'PLUTO', what would be present in that field after the UPDATE statement committed?

Thanls a lot!


Bill Thorsteinson
Honored Contributor

Re: null or void?

In the first case CLMN2 will be NULL, assuming that',,'
is treated as an implict null value.

In the second case CLMN2 should contain an empty string.
Some interfaces may treat this as NULL, and you may get
a NULL value in the database.

In both cases you have set the value so the default does
not come into play. The following should use the default.

insert into PIPPO (CLMN1,CLMN3)
values ('A','B');

If you want to use the default when the value is set to
NULL or an empty string, you should use a trigger.