• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 506
  • Last Modified:

sqlloader - invalid number

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
d27m11y
Asked:
d27m11y
  • 3
  • 2
1 Solution
 
flow01Commented:
can you provide the table definition of  stg_citco_intraday_trade ?
0
 
flow01Commented:
$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
 
Gerwin Jansen, EE MVETopic Advisor Commented:
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
Cloud Class® Course: SQL Server Core 2016

This course will introduce you to SQL Server Core 2016, as well as teach you about SSMS, data tools, installation, server configuration, using Management Studio, and writing and executing queries.

 
d27m11yAuthor Commented:
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
 
flow01Commented:
# 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
 
d27m11yAuthor Commented:
useful
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Cloud Class® Course: MCSA MCSE Windows Server 2012

This course teaches how to install and configure Windows Server 2012 R2.  It is the first step on your path to becoming a Microsoft Certified Solutions Expert (MCSE).

  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now