Getting number of affected rows in SQLPLUS..


Posted on 16th Feb 2014 07:03 pm by admin

Hi everyone,
I have a shell script where i am invoking sqlplus, running a query and saving the result in a spool file in a .csv format. Now this file has a trailer that contains
number of rows selected. So i cant use SQL%ROWCOUNT and i dont know how to get that number.
Someone has given me a idea to wc line count the file and append it as a trailer, but i cant do that as in the trailer line i have to display a number that is a oracle
Did you know?Explore Trending and Topic pages for more stories like this.
sequence. The file format will be something like this ---

01,Test,5667889,9999999,AXCCRTR1
000001,TESTSOURCE,1 ---------------> This is the trailer (oracle_seq,constant varchar,no of rows selected)

Is there any way i can get the number of rows affected by the previous query in sqlplus. Any help will be greatly appricaited.
I can go ahead and do it with Pl/sql but i'll not quit untill i am absolutely sure thery no way out for this.

Thanks,
No comments posted yet

Your Answer:

Login to answer
142 Like 8 Dislike
Previous forums Next forums
Other forums

Deleting Partners on the Customer Master.
Does SAP handle removing the Partner from Open Sales Orders when a Partner is deleted in the Custome

how to easy edit text, with box? Help.
Hi.
I have a little problem. I'm doing a webpage for my aunt and I would like to make it as easy

php require help needed
Ok i tried to use the search funtion but the word require is everywhere.

i'm really new to cr

Help with page encoding issue and weird characters
I'm trying to write a screen scraper and when I pull out the lines of the html file that I'm interes

Deleting pointers froms vector?
Hi. I have a vector filled with pointers and I want to delete the pointers. I could do a loop and do

Streaming local file from PHP while it’s been written to by a CURL process
I am creating a simple Proxy server for my website. Why I am not using mod_proxy and mod_cache is a

Database/Table Collation
What is the Database, and table collations used for? i don't understand what there used for since co

asp authentication problem
Hello all, I want to use the asp authentication (from asp.net configuration) in my web site. there

how make 2 column in table with data tybe long row
hi every one

I want make in my table 2 column with data tybe long raw

how thi

Mastering Regular Expressions, Third Edition, is available.
The Third Edition of Mastering Regular Expressions is available.

QuoteThis third edition is 5

Sign up to write
Sign up now if you have flare of writing..
Login   |   Register
Follow Us
Indyaspeak @ Facebook Indyaspeak @ Twitter Indyaspeak @ Pinterest RSS



Play Free Quiz and Win Cash