Page 1 of 1
File Validation with schema and column import
Posted: Thu Nov 03, 2016 7:38 am
by thurmy34
Hi Gurus
We want to validate the data Inside our input files.
We use schema file and the reject of the stage Column Import.
We have issues with the column string not nullable , the Column Import does accept the rows with null columes (ie ;;).
Code: Select all
record {final_delim='end', quote=none, delim=';'}
(
C1:string[max=24];
)
Thank you
Posted: Wed Nov 09, 2016 11:00 am
by Thomas.B
DataStage see that value as a 0 length string, not a null.
Did you try to use the "Null field value" option on the "Format" tab ?
Posted: Wed Nov 09, 2016 11:26 am
by thurmy34
HI
First of all i have to add that in our schema file we have column before and after my example.
Can you clarify the format tab thing ? Is it the one in the ouput tab Inside the column import stage ?
If so what is the right value ?
Thank you for your help.
Posted: Thu Nov 10, 2016 7:34 am
by Thomas.B
It is possible to set a string defining a null value in the Column Import stage or directly in the schema.
The easiest way is to add it to the schema, you can add the 'null field' property that way:
Code: Select all
record {final_delim='end', quote=none, delim=';'}
(
C1:string[max=24] { null_field = '' };
)
To add the property to all the fields you can also define the keyword on the schema definition:
Code: Select all
record {final_delim='end', quote=none, delim=';', null_field = ''}
(
C1:string[max=24];
)
Posted: Mon Nov 14, 2016 8:00 am
by thurmy34
Hi
When we change the schema file we have the following error.
Ci_XXX: At field "Col2": "null_field" used on not nullable field
Regards
Posted: Mon Nov 14, 2016 8:25 am
by chulett
Make it nullable.
Posted: Mon Nov 14, 2016 8:32 am
by thurmy34
I can't because it's not and i want to identify the wrong rows ...