Click here to Skip to main content
15,888,220 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
cant be able to solve this question.

What I have tried:

create or replace procedure job(jobid varchar(10))
begin
select * from employee
where job= jobid;
end//
Posted
Updated 6-Oct-21 22:21pm
Comments
CHill60 7-Oct-21 3:59am    
That code would appear to accept the jobid as a parameter and search the employee table for all employees with that job. So you have solved the question.
What is the problem?

1 solution

At a guess, calling your SP the same name as a column in your table might be a problem: I'd give the SP a more sensible name ("GetEmployeesByJob" maybe) and probably rename the column as well, if it does contain a row ID value. My standard for ID columns is to call them ID and specify the table name when I use it and there might be confusion:
SQL
SELECT c.Name, o.OrganisationName 
FROM Clients c
JOIN Organisations o
  ON c.OrgID = o.ID
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900