Page 1 of 1

Integer Validation issue

Posted: Sun Jan 08, 2012 10:35 pm
by vskr72
I have a column (loast column) coming from a flat file (fixed width). I am doing an integer validation for it using the below statement:

Code: Select all

If IsValid("int32", Col) then 'Valid' else 'invalid'
The values in the source file are between 0 to 5. I was expecting the output to be 'Valid'. But surprisingly its 'Invalid'. Not sure if I am doing anything wrong.

Posted: Mon Jan 09, 2012 1:23 am
by pandeesh
Are you sure that , the column contains a single digit only? i believe there's some non printable characters after that.
try:

Code: Select all

If IsValid("int32", trim(Col)) then 'Valid' else 'invalid' 

Posted: Tue Jan 10, 2012 3:48 am
by premupdate
The output of IsValid function is either 1 or 0.Change the derivation accordingly.

Posted: Tue Jan 10, 2012 4:01 am
by pandeesh
premupdate wrote:The output of IsValid function is either 1 or 0.Change the derivation accordingly.
Not necessary to change!
As you said it returns true or false.
If true then valid else invalid.

Posted: Tue Jan 10, 2012 7:42 am
by chulett
So, what was the actual resolution? Posting that information helps future searchers...