Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: using dblinks in stored procedures?

Re: using dblinks in stored procedures?

From: Chris <cs123._no_spam__at_telstra.com>
Date: Sat, 13 Dec 2003 02:35:29 GMT
Message-ID: <RVuCb.50287$aT.23694@news-server.bigpond.net.au>

<scott.micciche_at_sbcglobal.net> wrote in message news:4LuCb.70711$cc7.55834_at_newssvr25.news.prodigy.com...
> I'm having a problem passing an arg ( a valid dblink ) to a pl/sql
function. The problem is that I'm using the variable in it's place and the procedure won't compile with errors. The error states that the dblink is invalid. The code is similar to the following:
>
> v_link VARCHAR2;
>
> select sysdate
> from dual_at_v_link;
>
> The query is a bit different, but passing this invalid dblink using a
variable doesn't work, so I'm having to create a function for each db I do have valid links for and hardcoding the dblink in the function.
>
> I've looked in many pl/sql books and have found no answers, if this is the
wrong NG for this question, can someone please point me to the correct forum? Thanks in advance.
>
> Scott
>
> please post back to the NG, thanks.

You'll have to build a statement and then execute it.

v_sql := 'select sysdate from dual @'||v_link;

Then execute v_sql Received on Fri Dec 12 2003 - 20:35:29 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US