Subject ISQL and NOT NULL fields
Author Ivan Prenosil
Imagine you have corrupted database/table such that there are NULLs
in NOT NULL field (e.g. when you add NOT NULL constraint to already
populated table by updating system table).

If you prepare SELECT for this table, SQLTYPE of the column in XSQLDA
will be even number (indicating not-null field), and SQLIND will not be
updated during Fetch, i.e. you do not get any information whether
real data in the field are null or not; you get zero value or empty string
instead of null.

This behaviour is probaly o.k. for applications, but is it good for tool
like ISQL ? IMHO it would be better to show real data,
i.e. show <null> if there is null.

If you look at our bad table with WISQL, you can see <null>s !
The trick is to set the lowest bit of SQLTYPE to one before executing
command.

Which variant do you think is better for ISQL ?
To show '0' or '' instead of '<null>' (like in current ISQL),
or to show null as '<null>' (like in WISQL ) ?


Ivan
http://www.volny.cz/iprenosil/interbase