cancel
Showing results forย 
Search instead forย 
Did you mean:ย 

Null Values Not Written to Table

Damone
New Contributor

My Oracle input is address information similar to:
STREET: 123 MAIN STREET
CITY: ANYTOWN
STATE: ANYSTATE
ZIP: 12345
COUNTRY: USA

STREET: null
CITY: OTHERTOWN
STATE: OTHERSTATE
ZIP: 54321
COUNTRY: CAN

STREET: null
CITY: OTHERTOWN
STATE: null
ZIP: null
COUNTRY: USA

My desired output would be as follows:
123 MAIN STREET, ANYTOWN, ANYSTATE 12345 USA
null, OTHERTOWN, OTHERSTATE, 54321 CAN
null, OTHERTOWN, null null USA

My problem occurs when โ€˜STREETโ€™ (the first value) is null. In that case, my entire record gets written as null.

123 MAIN STREET, ANYTOWN, ANYSTATE 12345 USA
null
null

I have used variations of this expression, all without success.
$STREET.concat(", ", $CITY, ", " , $STATE , " โ€œ,$ZIP,โ€ ",$COUNTRY)

$STREET==null?โ€˜โ€™:$STREET.concat(", ", $CITY, ", โ€œ, $STATEโ€, โ€œ, :$ZIPโ€, ", $COUNTRY)

$STREET1==null?โ€˜โ€™:$STREET1.concat(โ€œ, โ€œ, $CITY==null?โ€˜-โ€™:$CITYโ€).concat(โ€, โ€œ, $STATE==null?โ€˜-โ€™:$STATEโ€) โ€ฆ

Any help figuring this out is appreciated.

4 REPLIES 4

Ajay_Chawda
Contributor

Hi @Damone
Did you try using string concatenation using โ€˜+โ€™ ?
$STREET+โ€˜,โ€™+$CITY+โ€˜,โ€™+$STATE+โ€˜,โ€™+$ZIP+โ€˜,โ€™+$COUNTRY
testCom_2022_06_14.slp (3.7 KB)

Regards,
Ajay

Hello,
Thank you for your response. Unfortunately, that isnโ€™t working either. Oddly enough, it actually writes โ€˜nullโ€™ out onto the table. Iโ€™ve been tweaking your expression, and I get close but keep hitting a wall. I think Iโ€™ll skip trying to use an expression and load the table using sql.

Hi @Damone
you need null value or empty or blank value for those null?

Regards,
Ajay

Good morning Ajay,
Iโ€™d prefer to keep them as null values.