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
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

Variable uses and placement
I'm new to PL/SQL and am trying to learn about variable valid uses/placement (any pointers to any do

retrieving more than one max key from an array?
so i have an array of 20 numerical values (0-100) that i need to order from highest to lowest and th

login to other site by sending post variables
hey,

here is my problem: my school gave me a mail account for school-stuff use. they mail us

Operating System
How in PHP or other language can I detect Operating system, ie Windows XP Home, Windows 7 Ultimate,

A problem with my GD class
Hello,

I created a nice (and simple for now) GD class.
The problem is , it works great on

How to kill asynchronous postback / current postback?
Hi,here is my problem:I have a web site with many pages of which some may take time to process resul

Drop Down and text box issue
Is it possible to set a drop down list and text boxes to a certain width?

here is my code

How could I do this?
Ive got a simple lottery game, and am using an sql database to keep track of the numbers bought. But

Inserting 100x and 100y coordinates in mysql table - easy
Is there a way to insert this data into a mysql table named 'map' with the fields: 'x int 3' , 'y in

need help about
i store the value of my select statement result to an array and stored it to a variable named $fname

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