CREATE MERGEDLOOKUP Statement |
The CREATE MERGEDLOOKUP statement creates a merged lookup table from two or more lookup tables based on a unique key. The MERGE ON statement works the same as the CREATE LOOKUP statement; there can be any number of MERGE ON statements between BEGIN and END.
Note |
---|
The BEGIN and END statements are mandatory. |
CREATE MERGEDLOOKUP ident BEGIN MERGE ON value FROM filename [WHERE expr] INDEX BY id; MERGE ON value FROM filename [WHERE expr] INDEX BY id; MERGE ON value FROM filename [WHERE expr] INDEX BY id; MERGE ON value FROM filename [WHERE expr] INDEX BY id; END;
ident | The identifier given to this newly created lookup table |
value | The value to index |
filename | The path to the shapefile containing the table |
expr | When the WHERE statement is used, expr is one or more logical expressions used to filter the selection rows in value |
id | A unique identifier used as the key in the lookup table |
This simple example creates a merged lookup table on post (ZIP) codes using city and town as keys.
CREATE MERGEDLOOKUP cityFromPostcode BEGIN MERGE ON %city FROM "data\NewZealand" INDEX BY %postcode; MERGE ON string.tolower(%town) FROM "extradata\NewZealand" INDEX BY %pc; END;