Discussion:
set attribute with multiple values
(too old to reply)
tharun reddy
2018-09-12 10:37:23 UTC
Permalink
i want to set the attribute with multivalues

i am using this

work.setAttributeValues(prop,subprop);

but i get only last value from subprop

subprop having multivalues.
Franzw
2018-09-12 13:13:34 UTC
Permalink
Post by tharun reddy
i want to set the attribute with multivalues
i am using this
work.setAttributeValues(prop,subprop);
but i get only last value from subprop
subprop having multivalues.
Look into the APIDOC of the Attribute : https://www.stephen-swann.co.uk/javadoc/tdi7.1.1/com/ibm/di/entry/Attribute.html - that includes sample code that explains how this works...

HTH
Regards
Franz Wolfhagen

PS. It will be a good idea going through this : https://www.ibm.com/support/knowledgecenter/en/SSCQGF_7.1.1/com.ibm.IBMDI.doc_7.1.1/generaltdiconcepts.htm
Enio Padilla
2018-09-12 17:09:56 UTC
Permalink
Post by tharun reddy
i want to set the attribute with multivalues
i am using this
work.setAttributeValues(prop,subprop);
but i get only last value from subprop
subprop having multivalues.
You could loop through the values in subprop, and then for each value use:

work.addAttributeValue(prop, subprop[i]);
tharun reddy
2018-09-14 05:18:28 UTC
Permalink
Post by Enio Padilla
Post by tharun reddy
i want to set the attribute with multivalues
i am using this
work.setAttributeValues(prop,subprop);
but i get only last value from subprop
subprop having multivalues.
work.addAttributeValue(prop, subprop[i]);
subprop is not array
Franzw
2018-09-14 06:14:34 UTC
Permalink
Post by tharun reddy
Post by Enio Padilla
Post by tharun reddy
i want to set the attribute with multivalues
i am using this
work.setAttributeValues(prop,subprop);
but i get only last value from subprop
subprop having multivalues.
work.addAttributeValue(prop, subprop[i]);
subprop is not array
You are not making it easy for us here to help you. We cannot read your mind, so when you are referencing "last value" it is very naturally to conclude that subprop was an array - so this is back to you....

Did you read up on Attribute in the APIDOC (and Entry as well) ?

You have to do your homework if you want the people here to help - we are doing this on our own time - so please consider this - it may be a very good idea to read this as well : http://www.catb.org/esr/faqs/smart-questions.html

Please start taking the time to understand the basic TDI principles - your questions are showing you are not understanding these yet - this is not a free lunch :-)

HTH
Regards
Franz Wolfhagen

Loading...