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

Post questions here relative to DataStage Enterprise/PX Edition for such areas as Parallel job design, Parallel datasets, BuildOps, Wrappers, etc.

Moderators: chulett, rschirm, roy

Post Reply
lshort
Premium Member
Premium Member
Posts: 139
Joined: Tue Oct 29, 2002 11:40 am
Location: Toronto

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

Post 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?
Lance Short
"infinite diversity in infinite combinations"
***
"The absence of evidence is not evidence of absence."
roy
Participant
Posts: 2598
Joined: Wed Jul 30, 2003 2:05 am
Location: Israel

Post by roy »

Hi,
This was covered not long ago
please search for this topic.
Roy R.
Time is money but when you don't have money time is all you can afford.

Search before posting:)

Join the DataStagers team effort at:
http://www.worldcommunitygrid.org
Image
lshort
Premium Member
Premium Member
Posts: 139
Joined: Tue Oct 29, 2002 11:40 am
Location: Toronto

Post 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)
Lance Short
"infinite diversity in infinite combinations"
***
"The absence of evidence is not evidence of absence."
elavenil
Premium Member
Premium Member
Posts: 467
Joined: Thu Jan 31, 2002 10:20 pm
Location: Singapore

Post 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
Eric
Participant
Posts: 254
Joined: Mon Sep 29, 2003 4:35 am

Post 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).
lshort
Premium Member
Premium Member
Posts: 139
Joined: Tue Oct 29, 2002 11:40 am
Location: Toronto

Post 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)
Lance Short
"infinite diversity in infinite combinations"
***
"The absence of evidence is not evidence of absence."
Post Reply