Cognos Data Manager Lookup Function

Cognos Data Manager Lookup Function

Cognos Data Manager Lookup Control Function

Function: Lookup

Category: Control

Syntax: Lookup( database_alias, sql_statement [, quote] [, max_values] );

Applicable For: Cognos Data Manager Procedure Node, Cognos Data Manager Function

Explanation: You can use Lookup function in Cognos Data Manager to execute SQL query against any database in Procedure node or User Define Functions. The output of this function is the result of executed query. As mentioned in syntax of Lookup you have to provide database alias and SQL statement both are menditory to use this function. Here database alias means database connection name(How to create Cognos Data Manager Connection). So how to use Lookup function. Below is the simple example:

Let's assume you have a database connection named 'EmployeeDB' and you want execute 'SELECT EmployeeName FROM tblEmployee WHERE EmployeeID=1' sql query. Then you have to use below command

LOOKUP( 'EmployeeDB', 'SELECT EmployeeName FROM tblEmployee WHERE EmployeeID=1;' );

So what is the output of above query.

  • If your query is returning single record than the output is Employee Name having EmployeedID equals to 1.
  • If your query is returning multiple records than the output is the comma separated Employee Names. 
  • If your query not found any records than the output is NULL.

Check this link for common error message while using Lookup function.

Still facing any issue leave a comment, i will reply you ASAP.

Your comments will be highly appreciated.

0 Comments
Leave A Comment

Please login to post your valuable comments.

Join the newsletter

Get the latest vLemonn news first

share