Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

SQL Loader Issues

Posted on 2004-09-01
1
Medium Priority
?
904 Views
Last Modified: 2013-12-11
I am having problems to load the next record:

more FAMA.dat
Fac.SQLL|1|DESCRIPCIÓN SQL|31-DEC-02|2002/12/01
00:00:00|1000|0|0|5|1063|32|1000|31-DEC-02||||2|||||||||||||||1|2|3|4|5|6|7|Y
ES|A9|A10|A11|A12|13|14|YES|0|A17|11|12|12|112|12|YES|A24|A25|A26|A27|21|21|21

Part of my control file looks like:

LOAD DATA
APPEND
INTO TABLE FA_MASS_ADDITIONS
FIELDS TERMINATED BY '|'
TRAILING NULLCOLS
(
INVOICE_NUMBER CHAR,
FIXED_ASSETS_UNITS      CONSTANT        '1',
DESCRIPTION     CHAR,
DATE_PLACED_IN_SERVICE  DATE    "DD-MON-RR", <---"Here is the error"
GLOBAL_ATTRIBUTE1 DATE 'YYYY/MM/DD HH:MM:SS',
FIXED_ASSETS_COST,
DEPRN_RESERVE,
YTD_DEPRN,
ASSET_CATEGORY_ID,
EXPENSE_CODE_COMBINATION_ID,


The log file says:

DATE_PLACED_IN_SERVICE               NEXT     *   |       DATE DD-MON-RR  ......

Record 1: Rejected - Error on table "FA"."FA_MASS_ADDITIONS", column
DATE_PLACED_IN_SERVICE.
ORA-01858: a non-numeric character was found where a numeric was expected.

I have verified this column and it is a DATE format.

Any help will be really appreciated.

TIA.
0
Comment
Question by:ramaswamymorla
1 Comment
 
LVL 1

Accepted Solution

by:
bestoracleexpert earned 600 total points
ID: 11951509
I recreate the table with all "big varchar2's" -- 25 looks big enough here:

ops$tkyte@ORA920>
ops$tkyte@ORA920> create table t
  2  ( c1 varchar2(25),
  3    c2 varchar2(25),
  4    c3 varchar2(25),
  5    c4 varchar2(25),
  6    c5 varchar2(25),
  7    c6 varchar2(25),
  8    c7 varchar2(25),
  9    c8 varchar2(25),
 10    c9 varchar2(25)
 11  )
 12  /
 
Table created.


and then i load a bad record.  In your case, I used:


ops$tkyte@ORA920> !cat test.ctl
LOAD DATA
infile *
APPEND
INTO TABLE T
FIELDS TERMINATED BY '|'
TRAILING NULLCOLS
( c1,
  c2 constant '1',
  c3,
  c4,
  c5,
  c6,
  c7,
  c8,
  c9 )
begindata
Fac.SQLL|1|DESCRIPCIÓN SQL|31-DEC-02|2002/12/01
00:00:00|1000|0|0|5|1063|32|1000|31-DEC-02|


now, when I load that -- i see:


ops$tkyte@ORA920> @printtbl8 'select * from t'
C1                            : Fac.SQLL
C2                            : 1
C3                            : 1
C4                            : DESCRIPCISN SQL
C5                            : 31-DEC-02
C6                            : 2002/12/01 00:00:00
C7                            : 1000
C8                            : 0
C9                            : 0
-----------------
 
PL/SQL procedure successfully completed.


so, you should be able to see the issue now -- that constant doesn't "skip"
a column -- it just stuffed a constant in there.  your fields don't line up at
all.  Your date is in column 5 -- not column 4.  So, you can:

ops$tkyte@ORA920> !cat test.ctl
LOAD DATA
infile *
replace
INTO TABLE T
FIELDS TERMINATED BY '|'
TRAILING NULLCOLS
( c1,
  foo filler,
  c3,
  c4,
  c5,
  c6,
  c7,
  c8,
  c9,
  c2 constant '1')
begindata
Fac.SQLL|1|DESCRIPCIÓN SQL|31-DEC-02|2002/12/01
00:00:00|1000|0|0|5|1063|32|1000|31-DEC-02|

ops$tkyte@ORA920> !sqlldr / test
 
SQL*Loader: Release 9.2.0.3.0 - Production on Sat Sep 6 13:04:42 2003
 
Copyright (c) 1982, 2002, Oracle Corporation.  All rights reserved.
 
Commit point reached - logical record count 1
 
ops$tkyte@ORA920> @printtbl8 'select * from t';
C1                            : Fac.SQLL
C2                            : 1
C3                            : DESCRIPCISN SQL
C4                            : 31-DEC-02
C5                            : 2002/12/01 00:00:00
C6                            : 1000
C7                            : 0
C8                            : 0
C9                            : 5
-----------------
 
PL/SQL procedure successfully completed.

and now, they'll be in the right place
 
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Working with Network Access Control Lists in Oracle 11g (part 1) Part 2: http://www.e-e.com/A_9074.html So, you upgraded to a shiny new 11g database and all of a sudden every program that used UTL_MAIL, UTL_SMTP, UTL_TCP, UTL_HTTP or any oth…
Cursors in Oracle: A cursor is used to process individual rows returned by database system for a query. In oracle every SQL statement executed by the oracle server has a private area. This area contains information about the SQL statement and the…
This video shows information on the Oracle Data Dictionary, starting with the Oracle documentation, explaining the different types of Data Dictionary views available by group and permissions as well as giving examples on how to retrieve data from th…
This video shows how to Export data from an Oracle database using the Datapump Export Utility.  The corresponding Datapump Import utility is also discussed and demonstrated.
Suggested Courses

782 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question