Link to home
Start Free TrialLog in
Avatar of graziazi
graziaziFlag for Afghanistan

asked on

Cursor in SQL

Hi. I want to use a cursor on a table of managers. If any manager has a salary less that 10k raise and error. If manager has salary > than 50k output a message and re-raise the exception.


This is what i have so far............


DECLARE CURSOR man_cur IS SELECT * FROM manager WHERE salary < 10000.........

I'm confused after this. Thanks
Avatar of slightwv (䄆 Netminder)
slightwv (䄆 Netminder)

I don't understand the question.  Please provide more of the requirements.

For example: are you wanting a pl/sql procedure with a loop through the cursor?  If you hit a vlue and raise an exception, it stops.  How do you want to 'output' a value before the exception?


Sample data and expected results would help a lot.
Avatar of graziazi

ASKER

Yes I want a pl/sql procedure with a loop through the cursor. Ok let's simplify by taking out the 90k clause
ASKER CERTIFIED SOLUTION
Avatar of slightwv (䄆 Netminder)
slightwv (䄆 Netminder)

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
Thank you