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 -> PL/SQL: Run remote package with db_link as variable

PL/SQL: Run remote package with db_link as variable

From: <xtremesparx_at_gmail.com>
Date: Wed, 10 Oct 2007 09:14:35 -0700
Message-ID: <1192032875.931672.131540@50g2000hsm.googlegroups.com>


If this is the wrong group I'm sorry. Just let me know and I'll take it there...

I am trying to run a package on several remote systems. As such, I'd like to just loop through the list of db_link's and then run it for each one. I am having a problem using a variable in the actual package call. I've tried several things, but what I'm currently trying is:

statement := 'package.procedure@'||dbaccess_info.db_link_name||'(var1, var2)';
DBMS_OUTPUT.PUT_LINE(statement);
statement;

When trying to run the 'statement' line I've tried running things like:

call statement;
exec statement;
execute immediate statement;

I know the literal string statement is correct but I can't get it to actually run as a package call.

I also tried using variable substitution and got it to go fine if I kept to running it through SQL Plus, but wasn't able to figure out how to use it in an automated fashion inside the program...

I've got to believe there's a way to do it either way and I don't really care which way it happens. I'm at my wits end right now (although I'll keep looking). This is my first attempt at PL/SQL and I've found it more challenging to pick up given my already limited background (mainly VB, PHP).

Any suggestions of how to make either the string variable execute or using variable substitution would be vastly appreciated, thanks. Received on Wed Oct 10 2007 - 11:14:35 CDT

Original text of this message

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