Command line examples

The following examples show various ways to use the database-specific adapter commands on the command line.

The following examples for data sources and targets are for Oracle database adapters using UNIX-specific syntax. For the Windows platform, adapter commands are enclosed in single quotation marks. Specify adapter commands using an .mdq file as follows:


dtx parts -ID1 "'-MDQ crib1.mdq -DBNAME Inventory 
-QUERY 003A'"

This example shows a data source override. The data for input card 1 for the parts map will come from the Inventory database using the query named 003A, all of which are defined in the crib1.mdq database/query file.

  • Override individual adapter commands as follows:
    
    dtx XlatLgcy -ID3 "'-STMT SELECT CustID, Name, 
    Addr FROM Cust_Table'"
    

This example shows how a SELECT statement may be specified on the command line. Note that the SQL statement consists of all of the input following -STMT until the next adapter command or until the single quotation mark ending the adapter command is reached. In this example, the remaining database information from the values compiled into the map file XlatLgcy is used (for example, the .mdq file, database, user ID, and other non-overridden values).

  • Specify and override the settings in an .mdq file:
    
    dtx CvtApps -OD6 "'-MDQ /test/new.mdq -DBNAME Purchases -USER 
    John -PASSWORD sds34u -TABLE NewerTable -UPDATE'"
    

This example shows that the target for output card 6 in a map named CvtApps. This map is first overridden by the database definition Purchases in /test/new.mdq by using the Database/Query File adapter command (-MDQ) and the Database Name adapter command (-DBNAME). The new.mdq database/query file is first read to override the data target that is compiled into the CvtApps map. Subsequently, the User ID adapter command (-USER), the Password adapter command (-PASSWORD), the Table Name adapter command (-TABLE), and the Update adapter command (-UPDATE) override those settings obtained from the .mdq file.

  • Override both a data source and a target adapter command:
    
    dtx XferMsgs -ID1 "'-MDQ /share/prod.mdq -DBNAME LgcyProd 
    -QUERY xToday'"    -OD1 "'-DBTYPE ORACLE -CONNECT ProdDB 
    -USER shaz -PASSWORD shaz01 -TABLE ActiveMsgs -UPDATE'"
    

This example shows both an input and an output being overridden. For the data source (-ID1), the .mdq file (/share/prod.mdq), database name (LgcyProd), and query (xToday) are specified. For the data target (-OD1), an Oracle database (ProdDB) is designated by the connect string. Subsequent adapter commands specify the user ID (shaz), password (shaz01), and table (ActiveMsgs) to be updated.