This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Custom SQL query in sync project

Hi,

If a customer's SQL or Oracle database application stores extension attributes in helper tables, we can use different sync steps and mappings to target each table separately, but one reason why this might not be a good idea is if there's a helper table which contains multiple rows.

 

Example: suppose a user account table doesn't store the account status in it, but a status table tracks changes from ACTIVE to INACTIVE so it has the entire history of each account through every CRUD transaction. We don't need to import every row from the helper table, we only need the most recent row for each account.

Is there any way to configure a SELECT statement as a new virtual extension to the schema instead of only using the objects provided, from inside a sync project? Something like this for example:

select acct.*
       , MAX(userStatus.UserID), userStatus.AccountState
from   accountdetails acct
       left outer join accountstate userStatus
       on acct.UserID = userStatus.UserID

Thanks

Parents
  • Thanks. It's not a huge issue as we can just create additional mappings and use object references to cover such use cases; this would've reduced the number of mappings needed in the sync project if it had been possible.
Reply
  • Thanks. It's not a huge issue as we can just create additional mappings and use object references to cover such use cases; this would've reduced the number of mappings needed in the sync project if it had been possible.
Children
No Data