dbTalk Databases Forums  

SQL*Plus and Feedback (xx Rows Selected) Line

comp.databases.oracle.misc comp.databases.oracle.misc


Discuss SQL*Plus and Feedback (xx Rows Selected) Line in the comp.databases.oracle.misc forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
absinth
 
Posts: n/a

Default SQL*Plus and Feedback (xx Rows Selected) Line - 05-22-2005 , 06:59 PM






Hi,

Consider the following SQL*Plus:

SQL> select row_id from CX_LOCK;

ROW_ID
---------------
1
2
3
4
5
6
7
8
9
10
11

ROW_ID
---------------
12

12 rows selected.

Is there a way to return the '12' rows selected in an SQL*Plus variable
or soemthing similar without doing another count?

I'm attempting to run a select statement (a complex one) that generates
a report but sometimes it takes so long to execute that it selects out
of an older snapshot of the database and returns less rows than
expected. I want to somehow save this number then run exactly the same
select but with a count(1) instead of column definitions and compare
the two numbers.

Any suggestions?


Reply With Quote
  #2  
Old   
IANAL_VISTA
 
Posts: n/a

Default Re: SQL*Plus and Feedback (xx Rows Selected) Line - 05-22-2005 , 07:28 PM






"absinth" <absinth (AT) gmail (DOT) com> wrote in
news:1116806364.144092.194130 (AT) o13g2000cwo (DOT) googlegroups.com:

Quote:
Hi,

Consider the following SQL*Plus:

SQL> select row_id from CX_LOCK;

ROW_ID
---------------
1
2
3
4
5
6
7
8
9
10
11

ROW_ID
---------------
12

12 rows selected.

Is there a way to return the '12' rows selected in an SQL*Plus variable
or soemthing similar without doing another count?

I'm attempting to run a select statement (a complex one) that generates
a report but sometimes it takes so long to execute that it selects out
of an older snapshot of the database and returns less rows than
expected. I want to somehow save this number then run exactly the same
select but with a count(1) instead of column definitions and compare
the two numbers.

Any suggestions?

Yes, use a different tool.

Rhetorical question - Since neither SQL nor SQL*Plus has the ability
to test & branch (IF ... THEN... ELSE...), how do you plan on making
use of the rowcount contained in a SQL*Plus varible?

The correct use of "tail" & "awk" utilities could be used to load up a
SHELL environmental variable.




Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.