Subject Re: [ib-support] Null
Author Nando Dessena
Lucas,

> If you select ALL fields of a table, do an INSERT and POST on the client
> side there are ofcourse NO DEFAULT values since the server doesn't
> receive NULL (it will receive an empty string for chars/varchars and 0
> for integers).
> Defaults do ONLY apply when the "value" IS NULL (well in fact that's not
> a value, it's more the "absence of a value").

you seem rather confused on this. The server won't apply a default if
the column is *at all* specified in the insert list; if you specify
null, an empty string, zero or whatever, the the default is not applied.
IE

insert into table1 (pk, data) values (1, null)

won't apply the default on data, whereas

insert into table1 (pk) values (1)

will.

IBO and other tools are able to pass null, empty string, zero or to
exclude the column from the insert list depending on what you tell them
to do. IBO is particularly versatile at that.

> That clients are handling a NULL-string as '' and NULL Integers as 0 is
> just for your convenience since otherwise you would never be able to
> handle them AsString or AsInteger without asking for IsNull before.

This is also untrue. AsString and AsInteger will just return the buffer
contents without worring about the null flag, so that an integer null
becomes 0 and a string null becomes ''.

> Or can you tell me how a NULL (NIL) should be represented in an Integer
> variable?

Null and nil are different beasts, please don't confuse'em.
HTH
--
____
_/\/ando