Simpler Navigation for Servers and Operating Systems - Please Update Your Bookmarks
Completed: a much simpler Servers and Operating Systems section of the Community. We combined many of the older boards, so you won't have to click through so many levels to get at the information you need. Check the consolidated boards here as many sub-forums are now single boards.
If you have bookmarked forums or discussion boards in Servers and Operating Systems, we suggest you check and update them as needed.
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.