8 Replies Latest reply on Nov 7, 2013 4:45 PM by John Kay-Oracle

    Using a variable db link for an interactive report

    John Kay-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,