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

Basic Forum Tutorial
Hi, I'm new to PHP. I want to build a basic forum for my site using PHP and MySQL. I've searched t

Help with search.php
Hello All

I need the search engine on a site I am building at the moment to display the searc

How to update this array?
I am saving a string that looks this: username1, username2, username3...
into a single cell in a

How would I protect......
I have a from, actually, a good amount of forms. How can I make it so you can't type the characters:

Regarding accessing SQL query issued by any user in Oracle 10g
Hi all,
i want to know the queries issued by various users accessing a database...

CODE NOT WORKING
Code: [Select]<?php
//include shared codes

include '../lib/common.php';
include

Getting the full city list from maxminds geoip database
I am suprised I can't find any references to this.

I have maxminds geoip lite installed and i

unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_
Can anyone view my code and tell me why im getting the error:
Parse error: syntax error, unexpect

How to store checkbox array in a session, and then be able to add to it?
I'm trying to store an array of checkbox values into a session array, sort of like a shopping cart,

Time-based image rotation script
I'm trying to write a PHP script that rotates an image based on what time of day it is. I want the

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