Number of rows loaded via sqlldr


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Number of rows loaded via sqlldr
# 1  
Old 05-19-2014
Number of rows loaded via sqlldr

Hi all,
I'm loading data in database through sqlldr.
I want to know the total record count
And the number of records inserted in table..
what is the logic to achieve that.

Thanks
# 2  
Old 05-19-2014
just add "log=load.log" in your sqlldr command.
inside log file you will come to know how many records inserted and how many records rejected due to errors.
# 3  
Old 05-19-2014
Actually I don't want full log file
I just want the records loaded n number of records rejected
# 4  
Old 05-19-2014
you have option bad=badfile.log to your sqlldr command.

you can do
Code:
cat badfile.log | wc -l

to get rejected records.

You can do
Code:
cat  file.csv | wc -l

to get total records

total records - rejected records = records inserted.

OR

query the table ( select count(*) from table_name) on which you are inserting data to get total inserted records

OR
inserted records
Code:
awk ' /Rows successfully loaded/ {print $1}' sqlldr.log

rejected records
Code:
awk ' /Rows not loaded due to data errors/ {print $1}' sqlldr.log


Last edited by Makarand Dodmis; 05-19-2014 at 08:17 AM..
# 5  
Old 05-19-2014
Hi,

I have text file as EG.txt

the file content is like:

CACZ885M2301|1569009|MONTH0|ERT|7001455|SUPINE|12
CACZ885M2301|1569009|MONTH0|ERT|7001455|SUPINE|12
CACZ885M2301|1569009|MONTH0|ERT|7001455|SUPINE|12

when i do /cat AE.txt | wc -l
it displays 2 instead of 3..

Any idea why its showing (number of rows - 1)
# 6  
Old 05-19-2014
You have 30 posts now. By now you should be aware that :

- always use code tags to post your data.
- create a new thread for new topic.


About your question, please make sure you don't have any blank line in the file.
This User Gave Thanks to clx For This Post:
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

SQLLDR :Data not loaded completely

Hi , I am using below control file LOAD DATA APPEND INTO TABLE LSHADMIN.EG TRAILING NULLCOLS ( STUDY CHAR ) and the text file to load data is CACZ885M2301 When I run below command: sqlldr userid=apps/apps control=/home/appsuser/dataload/ctl_file.ctl... (3 Replies)
Discussion started by: Pratiksha Mehra
3 Replies

2. Shell Programming and Scripting

extracting number of rows

if > wc -l data.txt > 100 (meaning there are 100 rows) i want to assgn 100 as n so that if i do >echo n it would give me 100 Thanks (5 Replies)
Discussion started by: johnkim0806
5 Replies

3. Shell Programming and Scripting

Delete rows with particular number of columns

Hello Guys I have a flat file with few thousands of rows. Now each rows have different number of columns I want to delete the rows which has not equal to 749 columns Can you guys please let me know how to do the same Your help is much appreciated. (2 Replies)
Discussion started by: Pratik4891
2 Replies

4. Shell Programming and Scripting

awk number rows from 1 to 3 in file

I have a file with the following format, i need to change de field9 each 3 rows to renumber field9 with gpo1, gpo2, gpo3. I need to use awk Original file field1 field2 field3 field4 field5 field6 field7 field8 gpo3 field1 field2 field3 field4 field5 ... (3 Replies)
Discussion started by: robonet
3 Replies

5. Shell Programming and Scripting

how to add the number of row and count number of rows

Hi experts a have a very large file and I need to add two columns: the first one numbering the incidence of records and the another with the total count The input file: 21 2341 A 21 2341 A 21 2341 A 21 2341 C 21 2341 C 21 2341 C 21 2341 C 21 4567 A 21 4567 A 21 4567 C ... (6 Replies)
Discussion started by: juelillo
6 Replies

6. Shell Programming and Scripting

How to get total records loaded from sqlldr log file

Hi, I am loading data in the database table through sqlldr. I have to find total records loaded from sqlldr log file and store it in a variable in my script. How do I get it? Thank you. (3 Replies)
Discussion started by: mrpranab
3 Replies

7. UNIX for Dummies Questions & Answers

Number Grouped Rows in File

I have a file containing 750,000 records and have managed to sort them by related columns and now i'd like to add an ID number to the front of each line of the records that are grouped together. Which probably makes no sense so i have provided some example data and desired result. Given data.txt... (2 Replies)
Discussion started by: RacerX
2 Replies

8. Shell Programming and Scripting

Ability to store number of rows

Hi, I am creating a korn shell script and i'm trying to find out what the total number of rows are in a specific text file and i need to store that number in a variable withing the script. i know wc -l gives you the number, but it also has some leading spaces and then writes out the file name... (2 Replies)
Discussion started by: scabral
2 Replies

9. Shell Programming and Scripting

return number of rows selected

Hi all, i am doing a perl script to read from a db. I am able to retrieve the rows, but i am unable to return the number of rows selected. i tried $selectedrows = $sth->numrows; i got the error msg: Can't locate object method "numrows" via package "DBI::st" i changed it to $selectedrows =... (7 Replies)
Discussion started by: new2ss
7 Replies

10. Shell Programming and Scripting

help getting records loaded from sqlldr log

Does anyone have the code to look in a slqldr log file and get the total amount of records loaded? If so, could you please post. Thanks much. (0 Replies)
Discussion started by: ecupirate1998
0 Replies
Login or Register to Ask a Question