8 Replies Latest reply: Nov 7, 2013 10:45 AM by John K.-Oracle RSS

    Using a variable db link for an interactive report

    John K.-Oracle

      I have a requirement where users will select an instance (db link) from an apex LOV and the data in an interactive report will query based on the db link selected.

       

      I can use a db link in an interactive report query but only if I provide the exact name of the link. If I do something link select * from foo@:P12_DBLINK it doesn't work.

       

      It seems my only option is to use something like apex_collection.create_collection_from_query and then I can build my query with dynamic sql and use a variable for the dblink name. Then I just create an IRR based on my collection.

       

      Does that sound like that correct approach and/or am I missing anything?

       

      Any suggestions are most appreciated,

      john