Add the database Select operation

Before you start:
This topic demonstrates how to add a database select operation that makes a qualified selection from the data source. In the spreadsheet value table, the $db:select statement has the default value fn:true(), which returns all entries in the table. You must therefore replace this value with one that qualifies the selection, for example:
$db:select.LAB13STA.ARGOSTR.XREF.STATE=$source/AirlineRequest/Purchase/Customer/State
This example selects only the records from the database where the STATE column is the same as the State input field. The For entry is shown with the value $db:select, which causes iteration over the values that are selected from the database. If you use an unqualified select, the following source to target mappings would exist:
Source Target
Street STREET
City CITY
Zip ZIP_CODE
FlightNumber FLIGHT_NO
Date TRAN_DATE
Price COST
CreditCard CC_NO
Status STATUS1
Details DETAILS
  1. From the Message Mapping editor spreadsheet value table, replace the existing value fn:true() with the required value.
  2. From the Message Mapping editor Source pane, open the $db:select expression, then open the following trees:
    1. the database tree (for example, AIRLINEDB)
    2. the schema tree (for example, AIRLINE_SCHEMTREE)
    3. the database table tree (for example XREF)
  3. From the Message Mapping editor Source pane, select the source (for example, ABBREV), and drag it onto the target (for example, STATE) in the Target pane. Note that a connection line is not displayed initially.
  4. From the Spreadsheet pane, you can see that the target field (for example, STATE) has been assigned a Select value (in this example, $db:select.AIRLINEDB.AIRLINE_SCHEMTREE.XREF.ABBREV). The value identifies a specified column in the database table (in this example, theABBREV column in the XREF table). Lines between the sources and targets now indicate that the mappings the have occurred.
  5. Save the mapping by clicking File > Save.
  6. Save the message flow.
  7. Check the Tasks pane to see if any errors have been generated.
You have now made a qualified selection from the database.
Now go to Deploy the mapping.
Related reference
Message mappings