Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Re: SQL*Plus and Feedback (xx Rows Selected) Line

Re: SQL*Plus and Feedback (xx Rows Selected) Line

From: IANAL_VISTA <IANAL_Vista_at_hotmail.com>
Date: Mon, 23 May 2005 00:28:07 GMT
Message-ID: <Xns965EB1B3CE107SunnySD@68.6.19.6>


"absinth" <absinth_at_gmail.com> wrote in
news:1116806364.144092.194130_at_o13g2000cwo.googlegroups.com:

> 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. Received on Sun May 22 2005 - 19:28:07 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US