I am using DECODE with SQL Loader.
My objective is to convert any of the following to NULL for a field called CODE:
Spaces
-111
I tried the following:
Problem is that (from what I guessfrom reading the documentation), DECODE seems to have coverted the value to the type as defined in the first expression- i.e. type for '' is VARCHAR or CHAR, and that the field is numeric....
anyway, the outcome is that -111 is not set to null. Any suggestions for getting around with this?
My objective is to convert any of the following to NULL for a field called CODE:
Spaces
-111
I tried the following:
Code:
CODE POSITION(249:260) INTEGER EXTERNAL "DECODE(trim(:CODE),'',null,'-111',null,:CODE)"
Problem is that (from what I guessfrom reading the documentation), DECODE seems to have coverted the value to the type as defined in the first expression- i.e. type for '' is VARCHAR or CHAR, and that the field is numeric....
anyway, the outcome is that -111 is not set to null. Any suggestions for getting around with this?