I have a situation where I need to do an update on a very large set of rows that I can only identify by their ID (since the target records are selected by the user and have noth
If you were on Oracle, I'd recommend using table functions, similar to Marc Gravell's post.
-- first create a user-defined collection type, a table of numbers
create or replace type tbl_foo as table of number;
declare
temp_foo tbl_foo;
begin
-- this could be passed in as a parameter, for simplicity I am hardcoding it
temp_foo := tbl_foo(7369, 7788);
-- here I use a table function to treat my temp_foo variable as a table,
-- and I join it to the emp table as an alternative to a massive "IN" clause
select e.*
from emp e,
table(temp_foo) foo
where e.empno = foo.column_value;
end;