Page 1 of 1

import error and no default value; data: <empty>, at o

Posted: Wed Jun 15, 2005 6:42 am
by lshort
Sequential_File_0,0: Field "ANINTEGER" has import error and no default value; data: <empty>, at offset: 5

RKEY,varchar(10);ASTRING,varchar(10);ANINTEGER,int(10)

123||999
456||
789|aaa|

This error occurs in job:

SeqStage-->Peek

It appears that I am not allowed to have an empty string in an integer field. Anyone else come across this?
The only default it allows is an integer. So I guess I could change the empty string to 0 but thats not a true representation of what is coming from the source...or....do I just change all INT to VARCHAR and deal with it latter down the stream.

PX doesnt think its a NULL so all the NULL_HANDLING stuff goes out the window (been there done that).

Cant use ModifyStage or anything like that because it seems that this error occurs on import...before the data leaves the SeqStage

Comments?

Posted: Wed Jun 15, 2005 8:09 am
by roy
Hi,
This was covered not long ago
please search for this topic.

Posted: Wed Jun 15, 2005 8:38 am
by lshort
I did a search on the topic.

What I've found is that no one has a better answer than read as VarChar now change to Numeric later. The same conclusion I reached. I was kinda looking for a concensus from the masses that this is indeed the approach most of us are using. 8)

Posted: Wed Jun 15, 2005 9:49 am
by elavenil
How come you have empty string in an interger field. This is very strange. Would suggest you to define as varchar and transform it as integer later part.

Regards
saravanan

Posted: Wed Jun 15, 2005 10:21 am
by Eric
An empty string is not a Valid Integer, it should be 0 or Null.
A null is often represented in a sequential file as an 'empty' field.

If you set the column type as Nullable you can set the null value property so when you read the 'empty' fields in the sequential file they will appear as a NULL within DataStage (and any DataBase system you load the data into).

Posted: Wed Jun 15, 2005 12:58 pm
by lshort
If you set the column type as Nullable you can set the null value property so when you read the 'empty' fields in the sequential file they will appear as a NULL within DataStage (and any DataBase system you load the data into).
Actually Eric, I thought the same. Not so.
Nullable or Not-Nullable in the Null Value property appear to have no effect at all. The import sees it as an <empty string> not a <Null> that needs converting. 8)