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

OOP help
okay so i have a class im making it has everything setup i just need to randomize the 2 variables an

Need help with simple code, back and forward buttons.
Basically, I have a set of pages in a folder, which have the title somephrasehere_09.php, somephrase

Where is my php.ini???
Hi

First off - apologies - i'm not a coder so this may sound very amateur.

I'm having

limitations on array_unique()
Does any one know what/how imitations are applied to array_unique? I have an issue where no matter h

Save cookie to DB
I'm working on a pixel tracking script for an incentive website and I need to use an ASP script to s

check if value exists
I have googled this for a while and I am getting lots of different results. Is there a standard meth

SHOW TABLES Help
Hi all

I have the following

Code: [Select]<?php
$sql = "SHOW TABLES&quo

Filtering an Array Based on Value
I have a very simple script set up that pulls data from a database and is output using this code:

show the direct link into href
I want to display link on the page. i am fetching the data(URL) from database,actually before that i

Inserting into MySQL Newbie
Hi ive got a slight problem where ive made a simple web form where the customer inserts the ammount

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