Home » SQL & PL/SQL » SQL & PL/SQL » need help please (oracle 10g - linux (using vmware) and sql developer - windows)
need help please [message #437567] Tue, 05 January 2010 01:11 Go to next message
abhi4u
Messages: 1
Registered: January 2010
Junior Member
iam stuck with these can anyone help me


6. Create a stored function called GET_SERVICE_DAYS to retrieve the total number of days of service for a specific employee for the current position. The function should accept the employee ID as a parameter and return the number of days of service (distance of hire date from today). Add error handling to account for user input with invalid employee ID.

You can make use of the following template,

CREATE OR REPLACE FUNCTION get_service_days
(p_empid IN employees.employee_id%TYPE)
RETURN number
IS
v_days NUMBER(8);
BEGIN
(SQL to determine total number of days of services for the employee)

(Code for returning the output of this function)

EXCEPTION
WHEN (fill in the appropriate system exception) THEN
DBMS_OUTPUT.PUT_LINE ('There is no employee with the specified ID');
END get_service_days;





7. Create a stored function get_emp_count to print the number of people working in a specific department. The function should accept the department name as a parameter and return the number employee in that department. Add error handling to account for user input with invalid department name.


For example, if user inputs Marketing, you will see the following output from SQLDeveloper.

2 employee(s) work for the Marketing department
v_Return = 2



8. Create a stored procedure promote_programmer to promote programmers who earn more than 5000 to Senior Programmer and increase their salary by 15%. Hint: Use a cursor with FOR UPDATE and CURRENT OF syntax

You will need to add a record in the JOBS table first. You can use the add_jobs procedure developed before to add a record into the job table, with JOB_ID = SN_PROG, JOB_TITLE = Senior Programmer, Min_salary = 5000


and please tell me where i can learn pl/sql iam dumb in it.
Re: need help please [message #437568 is a reply to message #437567] Tue, 05 January 2010 01:18 Go to previous message
ramoradba
Messages: 2454
Registered: January 2009
Location: AndhraPradesh,Hyderabad,I...
Senior Member
If you really know the logic You can easily implement.
Here no one do the home work for you.
So show us what you tried/result.So that the members here will help you.
Quote:
and please tell me where i can learn pl/sql iam dumb in it.

From here you can select Your desired Book.

Goodluck
sriram Smile
Previous Topic: Parallel DML is not working.
Next Topic: sql developer vs toad, indexing
Goto Forum:
  


Current Time: Sun Sep 25 19:41:15 CDT 2016

Total time taken to generate the page: 0.84089 seconds