Data Transformation Engine Database Interface Designer Reference Guide

Chapter 7 - Database Functions Using DBLOOKUP and DBQUERY
Database Interface Designer Reference Guide
111
DBLOOKUP and DBQUERY execute an SQL statement within a rule against the
database. The SQL statement can be any statement permitted by your database
management system or database-specific driver.
There are two syntax methods that can be used to specify the arguments for
these two functions: Syntax1 and Syntax2.
Syntax1 - Using a Static .mdq File
Use Syntax1 to execute a SELECT statement that retrieves a specific column value
from a large table in a database using the value of another input, as opposed to
having to define the entire table as an input card and using other functions such
as
LOOKUP, SEARCHDOWN, or SEARCHUP. For more information about these
functions, refer to the Functions and Expressions Reference Guide.
Note If column data from a table or database varies because it may be based upon a
parameter file, use Syntax2. For more information, refer to Syntax2 - Using
Dynamic Adapter Commands.
Syntax1 is a three-argument syntax, examples of which follow:
DBLOOKUP(
SQL_statement,mdq_file,database_name
)
DBQUERY(
SQL_statement,mdq_file,database_name
)
Using this syntax,
DBLOOKUP and DBQUERY use the following arguments.
Argument Explanation Must Be
SQL_statement
single-text-expression a valid SQL statement
mdq_file
single-filename a string literal
database_name
single-database-name a string literal