[erlang-questions] Re: mnesia and nul data

Geoff Cant nem@REDACTED
Fri May 7 22:31:24 CEST 2010


There is no null value in erlang that has any special semantic meaning[1] - by convention we tend to use the atom 'undefined' but you could use anything you like. If your record definitions don't specify default values '-record(some_rec, {foo = default, bar = 12, baz}', then they'll default to 'undefined' (as #some_rec.baz does in that example).

In fact, I would suggest that you use some descriptive atom that notes why there is no value; using 'not_applicable', 'pending', 'waived', 'unknown' has no cost over using 'undefined' and may make debugging data issues easier later.

Cheers,
-Geoff
[1] neither erlang nor mnesia implements the awful three-value-logic that SQL uses (true/false/null).

On 2010-05-07, at 13:16 , Wes James wrote:

> looks like I was missing a couple of columns of data.  I'd still like
> to know the default nul or blank value to put in a field.
> 
> thx,
> 
> -wes
> 
> ________________________________________________________________
> erlang-questions (at) erlang.org mailing list.
> See http://www.erlang.org/faq.html
> To unsubscribe; mailto:erlang-questions-unsubscribe@REDACTED


More information about the erlang-questions mailing list