Page 1 of 1

NULL determination / handling

Posted: Thu Aug 20, 2009 1:35 pm
by rcanaran
This started in a previous post :
APT_CombinedOperatorController,0: Null string argument.

I think my current question, though related, is deviating from the original question so I started a new topic.

Me : "(an EMPTY string; I guess this differs from a NULL string)"
chulett : It most definitely does. Differ, that is.

Most of the time I am dealing with sequential or CFFs being loaded into and RDBMS (with some sort of transform or modification in between, oterwise I would just be perfoming bulk loads).

The data is either delimited or fixed length, but a NULL string is usually indicated via 2 delimiters with nothing between. Does Datastage set a null indicator for this or treat this as an empty string?

First I should ask if DataStage is maintaining a null-indicator for each nullable column like the RDBMSs do? If so, when NOT reading from an RDBMS, how does one set this indicator? Derive the column to @NULL or @NULL.str ? And then does IsNull query this indicator without looking at the content of the field?

Posted: Thu Aug 20, 2009 5:28 pm
by ray.wurlod
When reading from an RDBMS DataStage has two possibilities. For a Table read, the database server returns a null indicator only, which DataStage converts to its own internal representation (@NULL, if you like). For an SQL query the database server converts the null into a zero-length string, or perhaps into a special token such as "{null}". DataStage needs to be given the representation of null (this is akin to the Null Field Value when working with Sequential File stage) and, again, converts this to its own internal representation.