Field "BEHAVIOUR_ID" has import error and no defau

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
ysrini9
Participant
Posts: 108
Joined: Tue Jul 12, 2005 2:51 am

Field "BEHAVIOUR_ID" has import error and no defau

Post by ysrini9 »

Hi,

I am getting below error

Field "BEHAVIOUR_ID" has import error and no default value; data: {0d}, at offset: 8

to load the entire data changed data type to number to varchar with unicode

I tried below 2 functions to load -1, it is not working

If Read_1.BEHAVIOUR_ID="" Then -1 Else (BEHAVIOUR_ID)

If IsNull(Read_1.BEHAVIOUR_ID) Then -1 Else Read_1.BEHAVIOUR_ID

please help me how to insert -1. I am using datastage 8.1 and oracle 10g

Thanks and Regards
Srini.Y
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Search here for "has import error and no default value", oddly enough you're not the first person to see this message.
-craig

"You can never have too many knives" -- Logan Nine Fingers
siauchun84
Participant
Posts: 63
Joined: Mon Oct 20, 2008 12:01 am
Location: Malaysia

Post by siauchun84 »

Have you tried the NullToValue(Read_1.BEHAVIOUR_ID,"-1") function? Another question would be what is the datatype for the BEHAVIOUR_ID column?
venugopal.123
Participant
Posts: 9
Joined: Sun Jun 27, 2010 11:52 pm

Post by venugopal.123 »

Hi Sreeni see the correct null handling function try this :

If IsNull(Read_1.BEHAVIOUR_ID) Then "-1" Else Read_1.BEHAVIOUR_ID

It should be work try this and let me know...
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Look at the "bad" data. {0d} is a carriage return. I'd guess that you are reading a file that has DOS-style line terminators but have specified UNIX-style line terminators in the format properties of your Sequential File stage.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
siauchun84
Participant
Posts: 63
Joined: Mon Oct 20, 2008 12:01 am
Location: Malaysia

Post by siauchun84 »

If that the case, I would suggest you use If Trim(StringToUString(Read_1.BEHAVIOUR_ID))="" Then -1 Else (Read_1.BEHAVIOUR_ID).
Post Reply