Data Transformation Engine Functions and Expressions Reference Guide
Chapter 3 - Function Reference DBLOOKUP
Functions and Expressions Reference Guide
88
Returns
This function returns a single-text-item.
The
DBLOOKUP function returns the results of the query in the same format as
a query specified for a map input card, except that it does not include the last
carriage return/linefeed. Because this information is removed, it is easier to
make use of a single value extracted from a database.
Example
Assume that you have a table named PARTS that contains the following data:
Also assume that this database has been defined using the Database Interface
Designer in a file named mytest.mdq and that the name of the database, as
specified in the .mdq file, is PartsDB.
The
DBLOOKUP function …
DBLOOKUP ( "SELECT PART_NAME from PARTS where PART_NUMBER
=1",
"mytest.mdq",
"PartsDB")
… returns ¼" x 3" Bolt.
Using Meaning 2, you can also specify the
DBLOOKUP this way:
DBLOOKUP( "SELECT PART_NAME from PARTS where PART_NUMBER =1",
"-MDQ mytest.mdq -DBNAME PartsDB" )
where both the .mdq file name and database name is specified.
Or, this way, using Meaning 2 by specifying the database type and the
appropriate database-specific parameters:
DBLOOKUP( "SELECT PART_NAME from PARTS where PART_NUMBER =1"
,
"-DBTYPE ORACLE -CONNECT MyDB -USER janes " )
For more examples using the DBLOOKUP function, see the Database Interface
Designer Reference Guide.