I have a certain req which i am facing issue to acieve:
Source View has few access related records which get updated on regular basis as user is approved access.
Target table is kind of master table to maintain master data for each usr with access details.
The interface to transfer data about user access from source view to target runs every 30 min
Consider a scenario:
At 11, say USER1 requests for access to APP1 and is approved. this details will show up in source view.
Now interface will fetch this info and transfer to target master table.
Interface runs every 30 min, suppose USER1 request another access level for APP1 at 11:15, during this 30 min. Thus the view will now have 2 records, for USER1 one access level at 11 & other at 11:15.
The target table has primary key made up of USERID & ApplicationName as there should be only one record which should contain access detail for user-application combination.
In such a situation, if i run the interface transfering those 2 records from source view, it prompts me error saying primary key constraint voilated as it tries to insert 2 records for same user-app combbination.
How can i avoid this? is there any other way to maintain master details so that there is only one record for user- app combination
You should start by checking the Distinct checkbox on the Flow tab.
Or if you are also passing the dates to the target table which will make both the records as Distinct, then you should use LAST_VALUE analytical function in Oracle to get only the last record
Edited by: actdi on Mar 5, 2012 8:17 AM