<span style="color: #424246"> </span>
<span style="color: #424246">Extended properties can be accessed in the following four ways:</span>
<span style="color: #424246"> </span>
<span style="color: #424246"><strong>1. All template driven code generation</strong></span>
<span style="color: #424246">Template engine reference examples using pebble syntax:</span>
<span style="color: #424246"> </span>
table.extendedPropertyValuesByName["<propertyName>"]
table.loadInfo.sourceConnection.extendedPropertyValuesByName["<propertyName>"]
table.target.connection.extendedPropertyValuesByName["<propertyName>"]
<span style="color: #424246"> </span>
<span style="color: #424246"><strong>2. Automatic token replacement at run-time in Windows scripts</strong></span>
<span style="color: #424246">The automatic token replacement applies to Windows based scripts only. Each token is assessed at run-time immediately before executing a script in the same way parameters are replaced:</span>
<span style="color: #424246"> </span>
Token format: $WSL_EXT_<propertyName>$
<span style="color: #424246"> </span>
<span style="color: #424246">In the token replacement process, the first non-empty Extended Property value found is replaced in this order of preference:</span>
- Table or Export Object
- Associated Source Connection
- Associated Target Connection
If the Extended Property was found without any value set then an empty string is returned. $repo.objectsByName["<objectName>"].extendedPropertyValuesByName["<propertyName>"]
If the Extended Property was not found in the associated objects the token is left unchanged.
3. Calling the WslMetadataServiceClient.dll at run-time from Windows scripts
This is an advanced feature and not recommended for general use as it puts a reliance on loading this DLL at run-time from Windows scripts.
Below, an example on the PowerShell code block inside a RED PowerShell Script:
Add-Type -Path "${env:WSL_BINDIR}WslMetadataServiceClient.dll"
$repo = New-Object WslMetadataServiceClient.Repo("${env:WSL_META_DSN}", 'SQLServer',
"${env:WSL_META_USER}", "${env:WSL_META_PWD}", "${env:WSL_META_SCHEMA}",
"_${env:WSL_META_DSN_ARCH}")
4. WhereScape Database Enablement Packs
WhereScape provides Database Enablement Packs for many target platforms, each pack includes a utility template with extended property lookup functions as well as a PowerShell and Python functions to call at run-time. For more information please contact your WhereScaperepresentative.