UpdateCodes
The UpdateCodes() function updates the codes for specified entities and code types in the Quintessence database. If the specified code type already exists for the entity, the code is updated. If not, then the code type and code is added for the entity. If there are already multiples of the same code type for the entity, the code marked as the default code in the database is updated.
Syntax
UpdateCodes (Entities, Code Types, Codes, ShowError)
Entities |
The entities to update
An entity is any element in the Quintessence database that has data associated with it and is identified by a code, for example, an instrument, portfolio, country or manager. Multiple entity codes are separated by commas.
|
Code Types | The code types to update |
Codes | The replacement codes |
Show Error | If ShowError is set to TRUE, an error message will be displayed if the function fails. |
Note:
If multiple entities, code types and codes are stipulated, the update will operate on a one-to-one basis. For example, UpdateCode (“VRR, PHO”, “StockExchange1 Alpha Code, StockExchange2 Constituent Code”…) will update the StockExchange1 Alpha Code for VRR and the StockExchange2 Constitutent Code for PHO.
Examples
Example 1. Add a new entity code and code type
Example 2. Update an existing entity code
Example 3. Update an entity code where there are multiple codes of the same code type
Database | |||
Entity | Code | Code Type | Default |
VRR | VRR | StockExchange1 Alpha Code | Y |
100U | TradableInstrument1 | Y | |
PHO | PHO | StockExchange1 Alpha Code | Y |
C72479 | StockExchange2 Constituent Code | Y | |
C77777 | StockExchange2 Constituent Code | N |
Example 1. Add a new entity code and code type
In this example, an entry for “VRR” with code type “StockExchange2 Constituent Code” does not exist. Therefore the entry is added.
Function |
=UpdateCodes(“VRR”, “StockExchange2 Constituent Code”,”C72483″, True) |
Updated database | |||
Entity | Code | Code Type | Default |
VRR | VRR | StockExchange1 Alpha Code | Y |
100U | TradableInstrument1 | Y | |
C72483 | StockExchange2 Constituent Code | Y | |
PHO | PHO | StockExchange1 Alpha Code | Y |
C72479 | StockExchange2 Constituent Code | Y | |
C77777 | StockExchange2 Constituent Code | N |
Example 2. Update an existing entity code
In this example, an entry for “VRR” with code type “TradableInstrument1” does exist. Therefore the entry is updated with the new code.
Function |
=UpdateCodes(“VRR”, “TIDM”,”100X”, True) |
Updated database | |||
Entity | Code | Code Type | Default |
VRR | VRR | StockExchange1 Alpha Code | Y |
100X | TradableInstrument1 | Y | |
PHO | PHO | StockExchange1 Alpha Code | Y |
C72479 | StockExchange2 Constituent Code | Y | |
C77777 | StockExchange2 Constituent Code | N |
Example 3. Update an entity code where there are multiple codes of the same code type
In this example, two entries for “PHO” with code type “StockExchange2 Constituent Code” exist. Therefore the entry marked as the default entry is updated with the new code.
Function |
=UpdateCodes(“PHO”, “FTSE Constituent Code”,”C88888″, True) |
Updated database | |||
Entity | Code | Code Type | Default |
VRR | VRR | StockExchange1 Alpha Code | Y |
100X | TradableInstrument1 | Y | |
PHO | PHO | StockExchange1 Alpha Code | Y |
C88888 | StockExchange2 Constituent Code | Y | |
C77777 | StockExchange2 Constituent Code | N |