Link to home
Start Free TrialLog in
Avatar of hraja77
hraja77

asked on

output from oracle query into unix while loop

Hi All,

i need to put the output of my sql query into a unix loop and check that the output increments.
I am just check archive logs produced in the last day and from the output i just want to check it increments correctly without a gap;
Below is the query to get my output list - how do i put this list into a unix loop and check the numbers increment ok - thanks

x=`
sqlplus -s  2>/dev/null <<EOF
sys/$passwd@cgrp as sysdba
set feedback off
set heading off
set trimout on
select sequence# from $view where first_time > sysdate-1;
exit;
EOF
`

the output from the above command is a string of numbers:
22581 22582 22583 22584 22585 22586 22587 22588 22589 22590

i just need to check the sequence order to make sure i have each number and no gaps
ASKER CERTIFIED SOLUTION
Avatar of vikas_madhusudana
vikas_madhusudana
Flag of India image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of hraja77
hraja77

ASKER

looks okay