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)
[DD] set Column (PK) as file name
cc96ai
In the DCT,
the filename is generated by javascript api
and I would like to set the filename as primary key in table.
does it possible to do that ?
or I MUST create a primary field name in the DCT to store the filename ?
Find more posts tagged with
Comments
Migrateduser
You can use DD tuple process to add the DCR file name as a key/value pair and this key can be used as the primary key.
cc96ai
I check on DD tuple process example,
which is something like that
[html]
[/html]
but how can I implement it into column field ?
< column name="filename" data-type="VARCHAR(255)" allows-null="no" is-url="no" value-from-field="
????/$filename
" / >
sample_report.zip
Migrateduser
Check out this web cast for more details
Enhancing Deployment Data in DataDeploy
Using the Tuple Preprocessor feature of DD you can add new key/value pairs to the existing tuple or modify the existing key/value pairs also.
You should add something like /dcr/filename=filename to the Hashtable and this key can be used in the dd config like
<column name="filename" data-type="VARCHAR(255)" allows-null="no" is-url="no" value-from-field=""/dcr/filename" />
You should not use /dcr/filename path in the DCT otherwise it will replace the value of the DCR with the value generated by the Tuple Preprocessor code.
cc96ai
Tuple Preprocessor (java class) is the
ONLY
way to do that?
Migrateduser
So, could you store the filename also as a hidden form element? FormAPI could assign that and you could get your value from value-from-field.
Depending on how you're calling OD to do the deployment, you could also pass it in as a value:
< column name="filename" data-type="VARCHAR(255)" allows-null="no" is-url="no" value="$filename^" / >
You would then need to define $filename in your command line, "-k filename=something"...
I might be oversimplifying but I'm not sure why either of those two wouldn't work for you.
Migrateduser
You can use "path" value i.e relative value of the DCR path from workarea and Filter & Substitution feature to manipulate the "path" value.
cc96ai
Thanks Dave,
I love those simply way,
and it works for me too.