Focal Point
Handling NULLS between PS and Oracle

This topic can be found at:
https://forums.informationbuilders.com/eve/forums/a/tpc/f/1381057331/m/5311009331

September 23, 2005, 07:14 PM
k.lane
Handling NULLS between PS and Oracle
I am using iWay 5.3 to load an Oracle 9x table. The source data is a PeopleSoft 8.4 table (oracle database).

The problem I am experiencing is with the use of nulls. Both of my tables (source and target) are both defined with all columns as NOT NULL. We did this because of the PeopleSoft side of the equation.

Specifically, I am receiving the following error when loading the Oracle table:

(FOC1574) ASSIGNMENT OF A NULL VALUE TO A NOT NULL COLUMN IS NOT ALLOWED
: ORA-01400: cannot insert NULL into ("SCR_STG"."PCR_SCR_VSRC3"."NAME2")
(FOC1416) EXECUTE ERROR : PCR_SCR_VSRC3

On the PeopleSoft side, NAME2 contains a space (NOT A NULL). Because of this, I am confused as to why the column appears to have a NULL when I insert into the Oracle table.

To get this to work, I had to include the following on the NAME2 column:

IF NAME2 IS MISSING THEN '.' ELSE IF NAME2 EQ ' ' THEN '.' ELSE NAME2;

My question is why does this occur? In the Peoplesoft table the value of the NAME2 column contains a space (if no value is present). Why would the transformation take this to be a null?

Ken
September 26, 2005, 04:01 PM
reFOCUSing
Ken,
I don't know if this will help but have you tried setting MISSING = ON ?

Check out these links:

http://techsupport.informationbuilders.com/ibase/master.../wf53ddlang/dif7.htm

http://techsupport.informationbuilders.com/ibase/master.../wf53crlang/mis3.htm
September 28, 2005, 06:35 PM
njsden
Ken,

Is your column PCR_SCR_VSRC3.NAME2 defined as CHAR or VARCHAR2 in Oracle?

I don't directly work with iWay 5.3 but I now about some issues it has when dealing with CHAR columns in Oracle .. somehow, if the field constains only spaces it's treated as empty (and thus converted to NULL) before sending it to Oracle, so when this one receives it what it gets is NULL and that would explain the error. Changing the data type to VARCHAR2 solved the problem (and provided some other significant advantages that VARCHAR2 has over CHAR in Oracle).

I don't know if that would be a problem in your case taking into account the interaction with PeopleSoft but it might be worth giving it a try.
September 29, 2005, 02:45 PM
k.lane
Interesting because my columns are defined as VARCHAR2 in Oracle.

Hmmmm.

A viable workaround for me right now is to define the columns as NULL. My main concern with with several Peoplesoft panels that would be used to update the tables and if the columns were defined to allow NULLS then how would PS react with it. However, this does not appear to be a problem with the PS panels as they display empty cells.

Your explanation on the conversion to nulls makes complete sense to me given the trials that I have performed. Thanks for the info! I definitely think this is more of an issue with Oracle.

Depending on future requirements, I may revisit this but I find it interesting that I cannot add a space to the Oracle columns.

Ken
February 24, 2006, 01:30 AM
<sandy_16>
quote:
IF NAME2 IS MISSING THEN '.' ELSE IF NAME2 EQ ' ' THEN '.' ELSE NAME2;

Hi Ken,
I needed a clarification on this error.I am getting the same error.as mentioned by you.where did you include the ELSE IF clause.

Regards
Sandeep