Dynamic SQL Select query (merged) [message #651867] |
Thu, 26 May 2016 11:52 ![Go to next message Go to next message](/forum/theme/orafaq/images/down.png) |
![](http://www.gravatar.com/avatar/fdb4ad22213fd7f1c19c4c5bba9c07b0?s=64&d=mm&r=g) |
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.
|
|
|
|
|
|
|
|