Page 2 of 2

Posted: Wed Jul 28, 2010 12:12 pm
by Nagin
If I remove nullable property for Col_One, that row is getting rejected if it has null. Again, Col_one is integer.

So, If I pass in a null or a string in Col_one it is rejecting successfully. I am just getting a warning in the log saying that import error and no default value.

Samething does not work for a string filed. If I pass in 123 in the string field it does not reject, probably because the number is read in as a string as this is a flat file. But for nulls, the row is not getting rejected

Posted: Wed Jul 28, 2010 12:23 pm
by anbu
String field accepts both numbers and alphabets. If you want to reject records containing numbers then use Num() as constraint

Posted: Wed Jul 28, 2010 2:17 pm
by Nagin
No, I am okay with String field accepting numbers. Are you saying we can use Num() in the schema file ?

Still the main purpose is I need to reject null strings at source schema file level

Posted: Wed Jul 28, 2010 2:21 pm
by Nagin
Gregg,
greggknight wrote: BEFORE_COMPANY:nullable string {null_field=''};

BEFORE_FACDIVN:nullable string {null_field=''};
Looks like this works for strings that are nullable. How can I reject strings coming in as null but are not nullable

Posted: Mon Aug 02, 2010 10:07 am
by Nagin
I found a work around, I had to add a filter stage after the sequential file stage and specify the where condition is not null for each of the not nullable columns.

Ofcourse, this works as I know the not nullable column names. But for a truely dynamic metadata scenario I don't know how this would work. This is probably one of those things that Datastage has a problem to deal with.

Thank you all for the help.