How do I perform a database lookup?

When using powerful databases like DB/2 it is possible to perform database lookup by nesting SQL statements.

 

Here is an example of how to write such a statement.

 

Example of database lookup

 

Please notice how the nested select statement is attempting to decode the Dispatch Group using the description retrieved from Excel.

 

The case statement is evaluating the number of rows returned and, if there is no match in the lookup nested select, is providing a default value of ‘D99’.

 

ODBCFace Home