Re: Remote Function Calls.
Date: Fri, 03 Nov 2000 17:57:18 GMT
Message-ID: <8tuu9r$lf2$1_at_nnrp1.deja.com>
I don't know if this will work in your case, but you might try it. What you need to do, I think, is to make your call constant, but change what it means. To do this, you set a synonym via the DBMS_SQL package (I did something like this before, but don't have access to the code anymore, so you might need to adjust the syntax):
dbms_sql.execute('drop synonym xyz');
dbms_sql.execute('create synonym xyz for remotepkg.remotefn_at_'||dblink);
v_return_val := xyz;
Like I said, this is the idea ... can't remember the specifics. You make a synonym that includes the link so your pl/sql function call always remains the same (xyz in this example). It's not the greatest solution because dbms_sql does not return a good error on ddl if things go wrong. I used a similar technique to request remote instances to create users for specific apps. HTH - Roger
In article <jcCL5.6987$e4.134076_at_e420r-sjo2.usenetserver.com>,
"Neil Barton" <nbarton_at_dpapplications.com> wrote:
> Hi,
>
> Within a PL/SQL stored procedure I need to call a remote function,
using a
> database link, with the returned value from the remote function
stored in a
> variable. However, the database link is not known until run time and
is
> passed as a parameter to the stored procedure.. How do you do this ?
>
> e.g v_return_val := remote_package.remote_function_at_DBLINK;
>
> The DBLINK value will not be known until executing the procedure.
>
> Any ideas?
>
> TIA
>
>
-- [Quoted] Have a good day! Roger Crowley DBA MedImpact Healthcare Systems, Inc. San Diego CA Sent via Deja.com http://www.deja.com/ Before you buy.Received on Fri Nov 03 2000 - 18:57:18 CET