Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> Re: Loading negative number using SQL*Loader
D Huynh wrote:
>
> Hi all,
>
> My input file looks like this:
>
> 99999|10|94|1090|229554.00
> 99999|10|95|-10|-2106.00
> 601150|5|81|10|1290.00
> 601150|5|82|10|1290.00
>
> And the control file is:
>
> LOAD DATA
> INFILE 'E:\Amgen\TB_FCT_DDD_ACCT_NDC_MTH.txt'
> INTO TABLE oncdata.TB_FCT_DDD_ACCT_NDC_MTH
>
> ( OUTL_ID decimal EXTERNAL terminated by '|',
> PROD_NDC_ID decimal EXTERNAL terminated by '|',
> TIME_MTH_CD decimal EXTERNAL terminated by '|',
> FCT_DDD_ACCT_UNITS decimal EXTERNAL terminated by '|',
> FCT_DDD_ACCT_DLLR packed decimal external(10,2))
>
If your datafile is what you say, then you shouldn't define your numbers as EXTERNAL - it means binary format. Here you don't have numbers, just honest character strings - made up of digits, that's all.Your control file should read :
LOAD DATA
INFILE 'E:\Amgen\TB_FCT_DDD_ACCT_NDC_MTH.txt'
INTO TABLE oncdata.TB_FCT_DDD_ACCT_NDC_MTH
FIELDS TERMINATED BY '|'
( OUTL_ID, PROD_NDC_ID, TIME_MTH_CD,
--
Regards,
Stéphane Faroult
Oriole Corporation
![]() |
![]() |