Page 1 of 1

Fatal Error: Attempt to setIsNull() on the accessor interfac

Posted: Wed Jun 14, 2017 4:29 am
by atulgoel
Hi,

I am facing the below error while reading the data from source using ODBC Connector. In source table all columns are NOT NULL and I am reading the table using RCP. While executing Its giving below error:

Fatal Error: Attempt to setIsNull() on the accessor interfacing to non-nullable field

Can anyone suggest something how to resolve the issue.

Posted: Wed Jun 14, 2017 7:24 am
by chulett
Did you try anything from the other thread you posted in? Specifically printing out the schemas via $OSH_PRINT_SCHEMAS.

Posted: Wed Jun 14, 2017 7:47 am
by Mike
Unfortunately the report of schemas generally gets lost when the job aborts.

1) Verify that you have no column metadata defined in the ODBC connector.
2) Verify that the sql select statement doesn't have any function that might result in NULL.
3) Replace everything after the ODBC Connector with a copy stage having no outputs.

Do you still get the fatal error?

Mike

Posted: Wed Jun 14, 2017 10:30 am
by chulett
That is... unfortunate. :(

If you still have the issue after going through all that, we'd probably need more details as to exactly what it is you have in the job.

Posted: Wed Jun 14, 2017 11:53 am
by atulgoel
Yeah I tried using Environment variable $OSH_PRINT_SCHEMAS, but still I am getting the error. It has not resolved my issue.

Posted: Wed Jun 14, 2017 11:57 am
by atulgoel
Hi Mike,

Below is my job design:

ODBC Stage ---> Copy Stage ---> Peek Stage

1) There is no metadata defined in ODBC connector.
2) My Select SQL statement has CAST function. I am converting all columns to VARCHAR using cast function. The column for which I am getting this error is of Numeric Type.
3) I have only Peek stage after copy stage in my job design.

The issue is still there. Kindly let me know if you need any more details in order to analyze the issue.

Posted: Wed Jun 14, 2017 11:58 am
by atulgoel
Hi Craig,

I have mentioned my job design in my previous comment. Please let me know what more details you need in order to get more details about issue.

Posted: Wed Jun 14, 2017 12:43 pm
by chulett
Thanks. All I have right now is just to clarify that adding that "print schemas" APT variable was not meant to fix anything. It was to log additional information so that you could figure out what might be going on.

If you added it and its information managed to survive the job's abort, can you post the output from it here?

Posted: Wed Jun 14, 2017 12:48 pm
by chulett
As Arnd mentioned in the linked thread, the use of the CAST function in your source SQL creates (as far as DataStage is concerned) a new column that is nullable. It doesn't mean you have null values in the data, just that the job thinks there could be, which from what I recall triggers the error when it tries to check for them. Mike, have you seen that behavior before?

Your print schemas output would show if that is what is happening, if it is in the log.

Posted: Thu Jun 15, 2017 12:22 am
by atulgoel
Here is the output for $OSH_PRINT_SCHEMA

Code: Select all

main_program: Schemas:
Data set "ODBC_Connector_0:DSLink2.v": 
record
( BICOD: string[max=10];
  BIBKC: string[max=10];
  BIBTN: string[max=10];
  BIANO: string[max=10];
  BICUR: string[max=10];
  BITRN: string[max=10];
  BIAMT: string[max=10];
  BICHQ: string[max=10];
  BIPDT: string[max=10];
  BIBTN2: string[max=10];
  BIVDAT: string[max=10];
  BILOC: string[max=10];
  BIPBI: string[max=10];
  BIPHR: string[max=10];
  BINRRN: string[max=10];
  BIPRRN: string[max=10];
  BITRRN: string[max=10];
  BIPRDT: string[max=10];
  BIPUDI: string[max=10];
  BIPHRP: string[max=10];
  BIPSTM: string[max=10];
  BICLNO: string[max=10];
  BISCBL: string[max=10];
  BIDEL: string[max=10];
  BIINTE: string[max=10];
  BIUMD: string[max=10];
  BIPNST: string[max=10];
  BISDI: string[max=10];
  BICMS: string[max=10];
  FILLER: string[max=10];
  BINFLG: string[max=10];
  BINTC_NBR: string[max=10];
  BIFPST: string[max=10];
  BIDRCR: string[max=10];
  BICHCD: string[max=10];
  BIITCD: string[max=10];
  BISBCD: string[max=10];
)
Data set "Copy_60:DSLink54.v": 
record
( BICOD: string[max=10];
  BIBKC: string[max=10];
  BIBTN: string[max=10];
  BIANO: string[max=10];
  BICUR: string[max=10];
  BITRN: string[max=10];
  BIAMT: string[max=10];
  BICHQ: string[max=10];
  BIPDT: string[max=10];
  BIBTN2: string[max=10];
  BIVDAT: string[max=10];
  BILOC: string[max=10];
  BIPBI: string[max=10];
  BIPHR: string[max=10];
  BINRRN: string[max=10];
  BIPRRN: string[max=10];
  BITRRN: string[max=10];
  BIPRDT: string[max=10];
  BIPUDI: string[max=10];
  BIPHRP: string[max=10];
  BIPSTM: string[max=10];
  BICLNO: string[max=10];
  BISCBL: string[max=10];
  BIDEL: string[max=10];
  BIINTE: string[max=10];
  BIUMD: string[max=10];
  BIPNST: string[max=10];
  BISDI: string[max=10];
  BICMS: string[max=10];
  FILLER: string[max=10];
  BINFLG: string[max=10];
  BINTC_NBR: string[max=10];
  BIFPST: string[max=10];
  BIDRCR: string[max=10];
  BICHCD: string[max=10];
  BIITCD: string[max=10];
  BISBCD: string[max=10];
)
Operator "ODBC_Connector_0": 
output 0 interface: 
record
( BICOD: string[max=10];
  BIBKC: string[max=10];
  BIBTN: string[max=10];
  BIANO: string[max=10];
  BICUR: string[max=10];
  BITRN: string[max=10];
  BIAMT: string[max=10];
  BICHQ: string[max=10];
  BIPDT: string[max=10];
  BIBTN2: string[max=10];
  BIVDAT: string[max=10];
  BILOC: string[max=10];
  BIPBI: string[max=10];
  BIPHR: string[max=10];
  BINRRN: string[max=10];
  BIPRRN: string[max=10];
  BITRRN: string[max=10];
  BIPRDT: string[max=10];
  BIPUDI: string[max=10];
  BIPHRP: string[max=10];
  BIPSTM: string[max=10];
  BICLNO: string[max=10];
  BISCBL: string[max=10];
  BIDEL: string[max=10];
  BIINTE: string[max=10];
  BIUMD: string[max=10];
  BIPNST: string[max=10];
  BISDI: string[max=10];
  BICMS: string[max=10];
  FILLER: string[max=10];
  BINFLG: string[max=10];
  BINTC_NBR: string[max=10];
  BIFPST: string[max=10];
  BIDRCR: string[max=10];
  BICHCD: string[max=10];
  BIITCD: string[max=10];
  BISBCD: string[max=10];
)
Operator "Copy_60": 
input 0 interface: 
record
( inRec: *;
)
output 0 interface: 
record
( outRec: *;
)
Operator "Peek_62": 
input 0 interface: 
record
( BICOD: string[max=10];
  BIBKC: string[max=10];
  BIBTN: string[max=10];
  BIANO: string[max=10];
  BICUR: string[max=10];
  BITRN: string[max=10];
  BIAMT: string[max=10];
  BICHQ: string[max=10];
  BIPDT: string[max=10];
  BIBTN2: string[max=10];
  BIVDAT: string[max=10];
  BILOC: string[max=10];
  BIPBI: string[max=10];
  BIPHR: string[max=10];
  BINRRN: string[max=10];
  BIPRRN: string[max=10];
  BITRRN: string[max=10];
  BIPRDT: string[max=10];
  BIPUDI: string[max=10];
  BIPHRP: string[max=10];
  BIPSTM: string[max=10];
  BICLNO: string[max=10];
  BISCBL: string[max=10];
  BIDEL: string[max=10];
  BIINTE: string[max=10];
  BIUMD: string[max=10];
  BIPNST: string[max=10];
  BISDI: string[max=10];
  BICMS: string[max=10];
  FILLER: string[max=10];
  BINFLG: string[max=10];
  BINTC_NBR: string[max=10];
  BIFPST: string[max=10];
  BIDRCR: string[max=10];
  BICHCD: string[max=10];
  BIITCD: string[max=10];
  BISBCD: string[max=10];
  inRec: *;
)
.

Posted: Thu Jun 15, 2017 12:24 am
by atulgoel
And I am getting this error with BIAMT Column

ODBC_Connector_0,0: Fatal Error: Attempt to setIsNull() on the accessor interfacing to non-nullable field "BIAMT".

Also I have tried running the job by manually defining the column in column definition and marked the nullability to yes on ODBC Connector stage and my job ran fine.

But the issue is, is there any option to force the nullability to yes (true) as we have in ODBC enterprise stage...

I need to have RCP in my job and I am using ODBC Connector stage.

Posted: Thu Jun 15, 2017 5:00 am
by atulgoel
Hi. I have resolved the issue. while using cast function in source sql we were defining the length of varchar less than the actual length in As400(Source DB)

In Source length was 13 and I was reading it like CAST(BIAMT AS varchar (10)) AS BIAMT

I increased the length to 142 and its running fine now.

marking this post as resolved

Posted: Thu Jun 15, 2017 6:42 am
by chulett
See, I told you it would help you figure it out. :wink:

Posted: Thu Jun 15, 2017 9:41 am
by Mike
Nice job of narrowing down the cause.

It's good to know that a failed cast function in the ODBC Connector results in NULL.

You mentioned AS400, so is your underlying database DB2?

Mike