Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

SQL Loader Issues

Posted on 2004-09-01
1
Medium Priority
?
902 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Have you ever had to make fundamental changes to a table in Oracle, but haven't been able to get any downtime?  I'm talking things like: * Dropping columns * Shrinking allocated space * Removing chained blocks and restoring the PCTFREE * Re-or…
When it comes to protecting Oracle Database servers and systems, there are a ton of myths out there. Here are the most common.
This video explains at a high level about the four available data types in Oracle and how dates can be manipulated by the user to get data into and out of the database.
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…

722 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