469,106 Members | 2,314 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,106 developers. It's quick & easy.

Linked Servers

Greetings all,
I am collecting data from 16 different Oracle databases into a single
database. I have a stored procedure to do this, but I'd like to pass the
procedure a value (linked Oracle database name) and have the stored procedure do
something similar to:

select * from table@v_remoteserver

where v_remoteserver is a variable.

Can I do this?

Thanks all,

Ron Hagerman
http://www.rons-sandbox.com
Jul 19 '05 #1
1 2474
Phoenix <ne**@rons-world.net> wrote
I am collecting data from 16 different Oracle databases into a single
database. I have a stored procedure to do this, but I'd like to pass the
procedure a value (linked Oracle database name) and have the stored procedure do
something similar to:

select * from table@v_remoteserver

where v_remoteserver is a variable.

Can I do this?


Dynamic SQL. In it simplest form, something like this in PL/SQL:

EXECUTE IMMEDIATE 'select * from table@'||v_remoteserver;

See the PL/SQL manual for more details.

--
Billy
Jul 19 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.

By using this site, you agree to our Privacy Policy and Terms of Use.