Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Dynamic dblink

Status
Not open for further replies.

TravisLee

Programmer
May 25, 2001
5
US
I am trying to run the following statement, which attempts to dynamically pass the dblink name, in a procedure:

select nvl(max(report_key), 0) into v_max_report_key from cym_reports||v_sn;

Where v_sn is initialized above to be '@dblink' using the statement - select '@'||CDS_SERVICE_NAME into v_sn from cym_org_list where org_id = x.org_id;

The statement is producing an error. The error is caused because it expects an @ symbol or a ; after the table name.

How can I dynamically append the dblink name to an sql statement and get it to execute from within a procedure?

Thanks
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top