Re: Linked Servers

From: Billy Verreynne <vslabs_at_onwe.co.za>
Date: 16 Sep 2003 23:52:25 -0700
Message-ID: <1a75df45.0309162252.7e5fdb5_at_posting.google.com>


Phoenix <news_at_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_at_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_at_'||v_remoteserver;

See the PL/SQL manual for more details.

--
Billy
Received on Wed Sep 17 2003 - 08:52:25 CEST

Original text of this message