Skip to Main Content

APEX

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Displaying results from dynamic SQL joining multiple tables

Life Long LearnerMar 17 2017 — edited Apr 27 2017

Hello,

I want to join 3 tables and display the results in a Region. Example query shown below. The columns from TableC below can change based on requirement (E.g. Below sql below has TableC - Column1, Column2, Column3, Column4, Column5. It could change to TableC - Column16, Column17, Column18, Column19, Column20, next run time to different set of columns). I want the results each time to display appropriate column headings based on the columns chosen in the dynamic SQL.

      SELECT TableA.Column1,

             TableA.Column2,

             TableB.Column1,

             TableB.Column2,

             TableB.Column3,

             TableB.Column4,

             TableC.Column1,

             TableC.Column2,

             TableC.Column3,

             TableC.Column4,

             TableC.Column5

        FROM TableA,

             TableB,

             TableC

       WHERE TableA.DateColumn = '10-FEB-17'

         AND TableA.Column1 = TableB.Column1

         AND TableB.Column1 = TableC.Column1

    ORDER BY TableA.Column1;

Any help is much appreciated.

Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on May 25 2017
Added on Mar 17 2017
14 comments
2,463 views