String to Integer Conversion

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
palak08
Participant
Posts: 75
Joined: Thu Nov 04, 2010 5:54 pm

String to Integer Conversion

Post by palak08 »

Hi All,

I am trying to load one Flat file toNetezza database. In flat file, I have a column as Varchar and in Target the datatype of column is Integer.

I am not using any function for explicit conversion in between. Now if I have data as 1234, it gets loaded correctly. But when I have data like 'abc', it inserts '0'.

Should not that record be rejected because of datatype issue?

The message I am geeting in log file is :
"Transformer_1,1: Numeric string expected for input column 'A'. Use default value."

Is there a way to get that record rejected in case of 'abc' and capture it in a file?

Thanks.
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Yes. Just use regular constraint expressions in the Transformer.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
jwiles
Premium Member
Premium Member
Posts: 1274
Joined: Sun Nov 14, 2004 8:50 pm
Contact:

Post by jwiles »

Use the IsValid() or Num() functions. This is standard data validation functionality.

Regards,
- james wiles


All generalizations are false, including this one - Mark Twain.
Post Reply