Add the database Select operation

Before you start:
Start of changeThis topic provides instructions on how to add a database select operation that makes a qualified selection from a data source. In the spreadsheet pane 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
End of change

Start of changeThe XPath in this example selects only the records from the database where the value in the STATE column for each record matches the value of the State field from the input message. In the spreadsheet pane the $db:select statement is associated with a For entry which is used to iterate over the mappings for the target message. For each row in the database matching the $db:select statement a separate target message is created with the mappings beneath $target. End of change

Start of changeThe following steps describe how to create message mappings to generate a target message based on records in a database matching the contents of an input message:End of change

  1. Start of changeIn the spreadsheet pane replace the existing value fn:true() with the value to match in the database (for example a field in the input message as shown in the preceding example).End of change
  2. Start of changeCreate mappings from the database fields in the Source pane to include in the target message, by dragging them from the source pane onto the target elements. A $db:select statement is added to the value column in the spreadsheet pane (for example, $db:select.AIRLINEDB.AIRLINE_SCHEMTREE.XREF.ABBREV).End of change
  3. Start of changeCreate any mappings you require from the source message to the target message.End of change
  4. Save the mapping by clicking File > Save.
  5. Save the message flow.
  6. Start of changeCheck for any errors in the Problems view. End of change
You have now made a qualified selection from the database.
Now go to Deploy the mapping.
Related reference
Message mappings