Solved

sqlloader - invalid number

Posted on 2013-05-26
6
483 Views
Last Modified: 2013-05-30
Attached is my control file and .csv file. I did attach another .xls which is the copy of .csv file for matching the name of the fields with the columns.

I am using .csv thru sqlloader, I keep getting "invalid number" when the data is numeric..
This is happening for columns, BX(Expenses- name of the column) and BB(TRA - name of the column).

Also, I get error on column BF, saying actual length is 4, maximum length is 3. But I see only three characters in.csv file for the column BF(settle_ccy -name of the column). Also, you can see I have used TRIM in my control file for varchar.

This is very urgent issue, please help !

Quick response is appreciated.
stg-citco-intraday-trade-ctl.txt
test-0523-orig.csv
test-0523.xls
0
Comment
Question by:d27m11y
[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
  • 3
  • 2
6 Comments
 
LVL 20

Expert Comment

by:flow01
ID: 39198094
can you provide the table definition of  stg_citco_intraday_trade ?
0
 
LVL 20

Expert Comment

by:flow01
ID: 39198159
$tradehome points to the right place ?

I used an external table definition csv_load (definition attached  (all columns varchar(255) except the one you mentioned) and a directory 'ext' i already had defined for

SQL> select expenses, settle_ccy, tra from csv_load
  2  /

  EXPENSES SET        TRA
---------- --- ----------
         0 USD          1
         0 USD          1
csv-load.v2.tab.txt
0
 
LVL 38

Expert Comment

by:Gerwin Jansen, EE MVE
ID: 39198832
How may records are loaded, this is feedback from the sqlldr command.

Have a look at the discard (.dsc) file to see which records are not loaded.
0
PeopleSoft Has Never Been Easier

PeopleSoft Adoption Made Smooth & Simple!

On-The-Job Training Is made Intuitive & Easy With WalkMe's On-Screen Guidance Tool.  Claim Your Free WalkMe Account Now

 

Author Comment

by:d27m11y
ID: 39201311
I tried to basically use a shell script for reading this, here is my shell and then tried to convert .csv file from dos to unix format and then it worked.

Please find attached DDL for the table stg_citco_intraday_trade. The first column is a sequence number for which I created a sequence and also created a trigger (before insert) so that it gets first column loaded there for every insert statement. Am attaching those as well.

#!/bin/ksh -xve

date

echo   'Started sqlloader stg_citco_intraday_trade'

if ( test -e "$tradehome/ods/data/csv/test_0523.csv")
then
   dos2unix $tradehome/ods/data/csv/test_0523.csv $tradehome/ods/data/csv/test_0523.csv
   echo $odspass | sqlldr $odsuser control=$tradehome/ods/ctl/stg_citco_intraday_trade.ctl  log=$tradehome/ods/log/stg_citco_intraday_trade_sqlldr.log
   cat $tradehome/ods/log/stg_citco_intraday_trade_sqlldr.log

fi

echo  'Ended sqlloader stg_citco_intraday_trade'
date

Open in new window



I may have to change my shell to ftp .csv file. Could someone suggest how to do that ?
ddl.sql
0
 
LVL 20

Accepted Solution

by:
flow01 earned 500 total points
ID: 39202163
# this is how a shell ftp session looks on our unix-box
ftp -i -n << EOF
open servername
quote USER username
quote PASS password
binary
put filename1 filename2
bye
EOF

#within the ftp-session you can use the regular ftp-commands
0
 

Author Closing Comment

by:d27m11y
ID: 39207966
useful
0

Featured Post

Salesforce Made Easy to Use

On-screen guidance at the moment of need enables you & your employees to focus on the core, you can now boost your adoption rates swiftly and simply with one easy tool.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Retreiving column names in Windows but not in Unix 11 76
add more rows to hierarchy 3 35
update using pipeline function 3 34
error starting form builder in 11g 2 27
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…
How to Create User-Defined Aggregates in Oracle Before we begin creating these things, what are user-defined aggregates?  They are a feature introduced in Oracle 9i that allows a developer to create his or her own functions like "SUM", "AVG", and…
This video shows syntax for various backup options while discussing how the different basic backup types work.  It explains how to take full backups, incremental level 0 backups, incremental level 1 backups in both differential and cumulative mode a…
This video shows how to recover a database from a user managed backup

726 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