Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> Re: sqlloader
If you treat the data in your input file as one field (num), try this:
....
DECODE (SUBSTR(num,4,1), '-', (TO_NUMBER(SUBSTR(num,1,3))*-1),
TO_NUMBER(SUBSTR(num,1,3))) POSITION (1:4) CHAR
Mind you, this will work (if it works at all - I haven't tested it) only if your input data is always as shown in your example (i.e., fixed length and format, with three digits followed by the +/- character). Otherwise, you could try using the INSTR function to identify the position of the +/- character in the field.
Hope this helps.
Michael Serbanescu
![]() |
![]() |