Keep in mind the following when working with the LookupDatabaseTable method:
-
When the kernel is loaded, the lookup keys and values are read into memory from the lookup table. The values in these columns are trimmed if any of these columns have a datatype of CHARACTER.
-
Since the key/value pairs used in the method are loaded from an SQL table when the model is loaded, the kernel needs to have available the specific table name and column names in the SQL table in order to load it. This means that when the LookupDatabaseTable is coded in an expression, these identifiers must be literals so that the kernel can identify the specific names. The identifiers can not be variables.
-
You should not code an invocation of this method in a procedure. This is not supported because a procedure is a "model-wide" object and is not associated with a specified server as a result expression or as a gate (condition) expression is. The lookup table is an SQL table that has to be available in the source server context, because the kernel needs to connect to a source server, but a user procedure (a new compiled method created in the "Data Enhancement Methods" list) is not associated with any particular server.
-
All the rows in the SQL table specified in this method are loaded into kernel memory when a model is loaded. Therefore, this method is generally more suited to small, static tables in which one wants to do key/value look ups.