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

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
atulgoel
Participant
Posts: 84
Joined: Tue Feb 03, 2009 1:09 am
Location: Bangalore, India

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

Post 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.
Atul
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Did you try anything from the other thread you posted in? Specifically printing out the schemas via $OSH_PRINT_SCHEMAS.
-craig

"You can never have too many knives" -- Logan Nine Fingers
Mike
Premium Member
Premium Member
Posts: 1021
Joined: Sun Mar 03, 2002 6:01 pm
Location: Tampa, FL

Post 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
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post 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.
-craig

"You can never have too many knives" -- Logan Nine Fingers
atulgoel
Participant
Posts: 84
Joined: Tue Feb 03, 2009 1:09 am
Location: Bangalore, India

Post by atulgoel »

Yeah I tried using Environment variable $OSH_PRINT_SCHEMAS, but still I am getting the error. It has not resolved my issue.
Atul
atulgoel
Participant
Posts: 84
Joined: Tue Feb 03, 2009 1:09 am
Location: Bangalore, India

Post 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.
Atul
atulgoel
Participant
Posts: 84
Joined: Tue Feb 03, 2009 1:09 am
Location: Bangalore, India

Post 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.
Atul
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post 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?
-craig

"You can never have too many knives" -- Logan Nine Fingers
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post 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.
-craig

"You can never have too many knives" -- Logan Nine Fingers
atulgoel
Participant
Posts: 84
Joined: Tue Feb 03, 2009 1:09 am
Location: Bangalore, India

Post 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: *;
)
.
Atul
atulgoel
Participant
Posts: 84
Joined: Tue Feb 03, 2009 1:09 am
Location: Bangalore, India

Post 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.
Atul
atulgoel
Participant
Posts: 84
Joined: Tue Feb 03, 2009 1:09 am
Location: Bangalore, India

Post 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
Atul
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

See, I told you it would help you figure it out. :wink:
-craig

"You can never have too many knives" -- Logan Nine Fingers
Mike
Premium Member
Premium Member
Posts: 1021
Joined: Sun Mar 03, 2002 6:01 pm
Location: Tampa, FL

Post 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
Post Reply