Dynamic SQL Select query (merged) [message #651867] |
Thu, 26 May 2016 11:52 |
|
richard_oak
Messages: 8 Registered: May 2016
|
Junior Member |
|
|
Hello,
I'm just learning PL/SQL and been trying to resolve my issue by myself but with no success yet.
This is what I'm trying to do:
CREATE OR REPLACE PROCEDURE "EMPLOYEES_BY_DEPT"
IS
V_EMP_ID NUMBER;
CURSOR GET_EMP_IP IS
SELECT EMP_ID FROM DEPARTMENTS;
BEGIN
OPEN GET_EMP_IP FOR
SELECT * FROM EMPLOYEES WHERE EMP_ID = GET_EMP_IP;
END;
I need to pull out all employees from the employees table where the emp_id exists in the department table.
|
|
|
|
|
|
|
|