|
-
How to use a cursor...????
Hello everyone i'm new to pl/sql and needed some help on cursors i was hoping someone could give me a layout of what i would need e.g. declare exection and exception which i can then try to have a go with the statements thanks even if someone can give me a start e.g. declare section then i can have a go
A description of the Employees and LEAST_EARNERS tables are shown below.
Employees TABLE
Name Null ? Type
empno NOT NULL NUMBER(4)
last_name VARCHAR2(10)
job VARCHAR2(9)
mgr NUMBER(4)
hiredate
salary
DATE
NUMBER(8)
LEAST_EARNERS TABLE
Name Null ? Type
salary NUMBER(8)
Create a PL/SQL block that determines the bottom n salaries of the
employees within an organisation and inserts them into a table called
LEAST_EARNERS. The block should prompt the user to accept a
number n from the user where n represents the number of earners
from the EMPLOYEES table. You should create a cursor called
emp_cursor that retrieves the salaries of employees in ascending
order. The salaries should not be duplicated. In the executable section,
open the cursor and fetch the least n salaries and insert them into the
LEAST_EARNERS table. Include any appropriate exceptions.
thankyou for the help in advance
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|