The following are some ideas on how to represent a NULL value in Tcl.


Use a string that contains a single null character

A null value in a table could be represented by a single null character (e.g. set null \x0000). This method would only fail when binary data is being stored and the entry contained one null character.

Use an array to store table entries

If an array is used to store table data then a missing (i.e. null) entry can be detected using the "info exists" command.

Isn't this equivalent to having a view containing key/value rows only when the value exists? -jcw


Forum Home  -  Site Home  -  Find Pages: