You can create a lookup table and save lookup values to
the primary spec so that users can select the lookup values from a
drop-down list. Lookup tables are useful for quick information retrieval
and for storing small amounts of data. You can update lookup tables
without needing to do mass update for all the items with the value
that you need to update.
Before you begin
Ensure that you have created the lookup spec which is required
to create a lookup table.
About this task
Lookup tables can be used:
- to store auxiliary data during aggregations,
- to populate output fields during syndications,
- as an attribute type in the primary spec, secondary spec or subspec,
- for quick information retrieval,
- to store small amounts of data,
- to create standard tables, for example units of measure (UOM,
unit of measure), currencies, or countries,
- to store values that can be assigned to IBM® InfoSphere® Master Data Management
Collaboration Server attributes
including attributes of the Global Data Synchronization feature, and
- to validate data contained in specific item or category fields.
For example, you might need to create a lookup table for storing long
financial values of foreign-exchange department of a bank.
Lookup tables can hold content for:
- Standard tables like units of measure (UOM), currencies or countries.
- Custom replacements tables (for example, BK = Black and BL = Blue).
Procedure
Create a lookup table by using any one of the following
methods: user interface, Java™ API,
or script API. You need to specify attributes and values
when you create the lookup table. To create a lookup table, provide
details such as lookup spec and the lookup table name.
| Option |
Description |
| User interface |
- Click Product Manager > Lookup Tables > Lookup Table
Console.
- Click the new icon.
- From the Select Type drop-down list, select Single
String Key and click Select.
- Select the lookup table spec to use.
- Provide a name and other required details for the lookup table.
- Click Next.
|
| Java API |
The following sample Java
API code creates a lookup table.Context ctx = PIMContextFactory.getCurrentContext();
LookupTableManager lookupTableMgr = ctx.getLookupTableManager();
SpecManager specMgr = ctx.getSpecManager();
LookupSpec lkpSpec = (LookupSpec)specMgr.getSpec("LookupSpec");
LookupTable lookupTable = lookupTableMgr.createLookupTable(lkpSpec, "MyLookupTable");
lookupTable.save();
|
| Script API |
The following sample script API creates a lookup table.var lookupSpec = getSpecByName("Default_LookUp_Spec");
var lookuptable = new LookupTable(lookupSpec, "TestLookupTable");
|
The lookup table is created. The users can create, delete,
and modify attributes and values of the lookup tables from the
Lookup
Table console.