Is it possible to have a Master Detail Interactive Grid using a View with Instead of Triggers so that in the Master I have records with INTERFACE_TYPE_CODE = 1 and in the Detail I have INTERFACE_TYPE_CODE = 2. For example I have
MASTER based on
Select TABLE_SK, VALUE_SK, ACTIVE_FLAG , INTERFACE_TYPE_CODE, TABLE_NAME from LOOKUP_TABLE_V where INTERFACE_TYPE_CODE = 1
Detail based on
Select TABLE_SK, VALUE_SK, ACTIVE_FLAG , INTERFACE_TYPE_CODE, TABLE_NAME from LOOKUP_TABLE_V where INTERFACE_TYPE_CODE = 2
The Primary_Key is VALUE_SK. The Table_Name can change over time but only one Table_name would be active at any given time.
In my application, I get an error saying that there must be the Table_Name defined for the Detail even though I do not have anything entered because I want to have the option of going back and adding the records at a later time.
I used to be able to do this in Oracle Forms
You can definitely create the two interactive grid based on the same table with different queries in Oracle Apex.
But I have a little confusion here, as you said, you are getting the error for the table name, actually, you don’t need to specify table name as a source when you are creating the interactive grid based on the query. Because the SQL query itself having the table name.
Or if you want to use the SQL query dynamically, then you can select the interactive grid source as PL/SQL function returning SQL query. Then you will be able to return a dynamic query based on any different tables.
You can check this post PLSQL function returning SQL query example. In this post, I have given the example for the drop-down list, but the same thing can be done for the interactive grid. This will surely help you to create a dynamic query for this kind of requirement.
Please let me know if any queries. Thanks.