We help IT Professionals succeed at work.

output from oracle query into unix while loop

780 Views
Last Modified: 2013-12-20
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
Comment
Watch Question

This one is on us!
(Get your first solution completely free - no credit card required)
UNLOCK SOLUTION

Author

Commented:
looks okay
Unlock the solution to this question.
Join our community and discover your potential

Experts Exchange is the only place where you can interact directly with leading experts in the technology field. Become a member today and access the collective knowledge of thousands of technology experts.

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.