I have created a database link that works correctly when the following statement is run:

select * from user.table@dblink

Now I want the name of the dblink to be able to be passed into a PL/SQL Procedure such that:

Procedure myProc(dblink varchar2) IS

begin
select * from user.table@dblink;
end;

and calling myProc('aValidDBLink') would return all records from the table in the database linked to via that aValidDBLink.

I've tried several attempts to concatenate the dblink string onto the end of the from clause, but none of it is valid. Aside from resorting to Dynamic PL/SQL is there any way of doing this? In the event that Dynamic PL/SQL is required could you give me some sample code that would achieve the desired effect, as I've never touched on it before.

Thanks in advance

Matt