How can I write a neat PL/SQL stored procedure that can execute against a given database link?
It gets really messy, writing stuff like this:
PROCEDURE my_proc(aDbLink IN VARCHAR2)
IS
BEGIN
EXECUTE IMMEDIATE '
SELECT mycolumn, anothercolumn
FROM MYTABLE@' || aDbLink || '
WHERE such-and-such...'
END
as the query gets bigger.
What else might I do? I'm stuck using stored procedures, and expect that my procedures will execute against one of several db links.