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

Email Form Syntax Issue
I need the TO: in email to display To: CEO instead of To: abc@mail.com

How to alter the scri

disabling a button server-side then re-enabling client-side breaks button postback
I have a tabbed container and a button (not in the container) on a page. If the first tab is selecte

Working with Dates, help.
Sooo to make a long story short, here's what im trying to accomplish.

I need to create a drop

cURL and Sessions
Ohai.

So, I'm trying to cURL a bunch of things off of a page, and put them into a session. I'

Refining of search Criteria
Dear Friends

I need a help, I have a search page which of cars related, which has different s

Spaghetti Code
So.

I've pretty much reached the point where I have so many isset s on one page that I can't

Dynamic Data + Sql Server 2005 Enterprise?
Hi! I have just started to learn ASP.NET, and it looks like it is quite a lot to learn. Im not reall

Dynamically set AccordianPane Header
I have an accordian on my master page. I'd like to be able to dynamically change the header on diff

AJAX form submit
I recently built a form that submits data to my database with an ajax function that is called throug

Error Messaging not working
I changed the way my form tells the user of an error. But I can't seem to get it to work properly.

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