How does one pass a complex value into a SELECT statement? I have a query I wrote for a project that I'd love to make into a stored procedure but am having trouble implementing it. This is what I am attempting, based on the emp table in scott/tiger:
I can set InStr to a single value easily, but how would I set InStr for multiple values, ie., "'10','20'"? I remember seeing it done once but can't seem to find it now and ORACLE doesn't seem to like embedded quotes. This is so frustrating!
Code:
DECLARE
InStr VARCHAR2(20);
BEGIN
SELECT COUNT(*)
FROM emp
WHERE deptno IN (InStr);
END;