Formatted numbers in SQL*Loader

From: Niel Bornstein <niel_at_prubank.com>
Date: Wed, 2 Jun 1993 19:48:23 GMT
Message-ID: <C80F0n.F99_at_prubank.com>


I am trying to load in a data file using SQL*Loader, and am having a problem with formatted numbers. By formatted I mean this file is a report that was grabbed from a mainframe report writer, and it looks all very pretty.

I've tried the following control file, without success:

load data
into table hist002
insert
when (1:4) != ' '
(

	TRAN_DATE				position(4:11) date 'MM/DD/YY',
	ACCT_NUMBER				position(15:24),
	PRIN_CASH_AMT			position(31:44) decimal(14,2) external,
	ADMIN_OFFICER			position(47:53),
	ACCT_TITLE				position(56:83),
	N						position(89:89)

)

Here's a sample of my data file (with incriminating details deleted):

        BANK: xxx    REPORT: HIST002                   DATE: 06/02/93    PAGE:    1

                      TRANSACTION HISTORY FOR CUSIP:  xxxxxxxxxxx


 TRANSACTION                  PRINCIPAL CASH   ADMIN              ACCOUNT
    DATE       ACCOUNT           AMOUNT       OFFICER              TITLE                N
 -----------  ----------      --------------  -------  ----------------------------     -
   06/01/93   xxxxx-xx-x            1,008.00  JAY      Foobar Industries                1

   06/01/93   xxxxx-xx-x              500.21  JAY      Quux Unlimited                   1
   06/01/93   xxxxx-xx-x              374.08  JAY      Quux Unlimited                   1

 *TOTAL ACCOUNT xxxxx-xx-x
                                      874.29                                            2

   05/28/93   xxxxx-xx-x              689.36  FBR      Hell's Angels                    1

   06/01/93   xxxxx-xx-x            1,172.02  JAY      Hell's Angels                    1
   06/01/93   xxxxx-xx-x              411.88  JAY      Hell's Angels                    1

 *TOTAL ACCOUNT xxxxx-xx-x
                                    1,583.90                                            2


SQL*Loader rejects records with greater than 999.99 principal cash amount, giving error ORA-01722: invalid number. Obviously, it's the comma, but I don't know what to do about this.

I can work around this by loading into a character field, then doing a sql "update hist002 set prin_cash_amt = to_num( prin_cash_char )" but I'd rather not.

Any other ideas?

BTW, it's server version 6.0.33.0.5, SQL*Loader version 1.0.26.0.7.

Niel

-- 
---------------------------------------------------------------------------

| Niel M. Bornstein * |
| Microcomputer Programmer, UNIX System Admin, etc. niel_at_prubank.com |
| * 71730.1056_at_compuserve.com |
| The Prudential Bank and Trust Company * |
| Two Concourse Parkway, Suite 500 1352 North Morningside Drive |
| Atlanta, Georgia 30328 Atlanta, Georgia 30306 |
| Office: (404) 872-6883 Home: (404) 551-8075 |
---------------------------------------------------------------------------
Received on Wed Jun 02 1993 - 21:48:23 CEST

Original text of this message