Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
PUBLIC CLOUD
PRIVATE CLOUD
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Web CMS (TeamSite)
DataDeploy ExternalDataSource returning multiple times?
Bill Klish
OpenDeploy 6.0.2 SP1
I am trying to do something I think is simple, but having a heck of a time getting DataDeploy to cooperate.
Here is the situation.
Database:
Product Family Table:
FAMILY_ID (key), FAMILY_NAME
Product Sub Family Table:
SUB_FAMILY_ID (key), FAMILY_ID (key), SUB_FAMILY_NAME
I have a single DCR that contains a replicant of product familes, which has a replicant of product sub families. I want to load the family table, then the sub family table using DataDeploy. I thought I could use the IWExternalDataSource feature to grab sequence numbers for all the replicant entries, but this doesn't work. It only returns me one value, as it seems this method tracks things by table, column and path. So, if I have 10 families, I get one sequence number.
The other problem is, if the sequence number is not in the original tuple, how do I get the family_id value created above into the sub family table? It seems the value is not visible, as the external data source will think it is a new table that it is getting a sequence number for.
I know I could update the DCT to have hidden ID fields, but I would rather avoid that.
Is there an easier way?
Find more posts tagged with
Comments
Bill Klish
There is no easy way to do this.
This has been added as Feature Request #66628
debus
You can use a tuple pre-processor (TPP) to fetch a sequence and add the sequence number to the tuple and reference it in your DD config.
However in a TPP you need to establish your own DB connection, you do not get datadeploy's connection as you do with external data source. So you need to know which database to talk to, which can be done by passing in parameters to the DD command whihc you can access from the TPP.
Hope this helps.
marcussteiner
i had a smililar situation once. where do you get the FAMILY_ID (key) from? is this done during the deployment process or could you also set this during the generation/workflow process? If you could do this before the deployment process (also through a db sequence) then you could set this value as an extended attribute and read it from there. Otherwise use the tpp just as debus suggested.
m
Bill Klish
See my other posts. We ended up writing a tuple pre processor, but it was not an optimal solution since we lose out on the database connection caching done by DataDeploy by having to write our own database.xml parser.