propsToAppend
cdba.copyUpdater propsToAppend string "propertyName"
Description
Prepends the value of the source library property to the value of the destination library property when both the source and destination libraries have the same property name, and this property name is mentioned in the environment variable. This feature is functional only when the g_overWrite argument of the ccpCopy SKILL function is set to nil.
You must specify this environment variable in the local .cdsenv file. This feature does not work if propsToAppend is set using the envSetVal SKILL function.
If values of more than one property are to be appended during a copy operation, specify the names of these properties in the environment variable by adding a space between each property name, as shown below:
cdba.copyUpdater propsToAppend string "propName1 propName2"
GUI Equivalent
Example
This example shows how to prepend the value of the source library property to the value of the destination library property using propsToAppend:
; Add prop to the source library.
propBag = dbOpenBag(srcLib "w")
prop = dbCreateProp(srcLib "prop" "string" "srcValue")
dbSaveBag(propBag)
dbPurgeBag(propBag)
; Add same named prop to the destination library.
propBag = dbOpenBag(dstLib "w")
prop = dbCreateProp(dstLib "prop" "string" "dstValue")
dbSaveBag(propBag)
dbPurgeBag(propBag)
list1 = gdmCreateSpecList()
list2 = gdmCreateSpecList()
spec1 = gdmCreateSpec("srcLib" "" "" "" "CDBA")
spec2 = gdmCreateSpec("dstLib" "" "" "" "CDBA")
gdmAddSpecToSpecList(spec1 list1)
gdmAddSpecToSpecList(spec2 list2)
ccpCopy(list1 list2 nil 'CCP_EXPAND_ALL)
; Query the prop value on the destination library.
\p >
\i dstLib~>prop~>value
\t ("srcValue dstValue" "cdsDefTechLib")
\p >
Related Topics
Return to top