Example 5 - using DBQUERY with adapter commands to obtain a single column value

This example demonstrates how you can use the DBQUERY function to enter adapter commands as an argument following database_name using the Syntax1 format:

DBQUERY("SELECT PART_NAME from PARTS 
   where PART_NUMBER =1",
   "mytest.mdq","PartsDB : -T -CS")

In the DBQUERY example above, the PART_NAME column value in the row that contains the PART_NUMBER column value of 1 will be retrieved from the PARTS table. The PARTS table is in the PartsDB Oracle database specified in the mytest.mdq file, which was produced by the Database Interface Designer.

This example uses optional database-specific adapter commands. The Trace (-T) adapter command will produce a database trace file. The Commit by Statement (-CS) adapter command will commit or rollback the transaction after the rule executes.