Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: Loading negative number using SQL*Loader

Re: Loading negative number using SQL*Loader

From: Stephane Faroult <sfaroult_at_oriolecorp.com>
Date: Mon, 22 Mar 1999 21:51:14 -0800
Message-ID: <36F72BC3.5EE1@oriolecorp.com>


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,

   FCT_DDD_ACCT_UNITS,
   FCT_DDD_ACCT_DLLR) SQL*Loader will check your table and do the required conversions all by itself ...  

--
Regards,

  Stéphane Faroult
  Oriole Corporation



http://www.oriolecorp.com, designed by Oracle DBAs for Oracle DBAs
Received on Mon Mar 22 1999 - 23:51:14 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US