Examples of database adapter commands

  • The following example shows a map rule using a DBQUERY function with database adapter commands to specify particular adapter settings.
    "-DBTYPE ORACLE -CONNECT MyDatabase -USER janes"

    This example uses the -DBTYPE ORACLE adapter command to specify the database adapter type as Oracle and -CONNECT MyDatabase to designate MyDatabase as the Oracle connect string. The -USER janes adapter command identifies janes as the user ID.

For information about using the DBLOOKUP and DBQUERY functions, refer to the Database Interface Designer documentation.

  • Use adapter commands with either the Input Source Override - Database execution command (-ID) or the Output Source Override - Database execution command (-OD) in a RUN function to override particular settings. The following example shows using a RUN function to specify adapter commands without using an .mdq file:
    RUN ("somemap.mmc" , 
          "-od1 '-dbtype oracle -connect remotedb -user " + 
          userid:profile + " -password " + password:profile + 
          " -table purchordr'")

In this example, a map named somemap.mmc is being run. The output of this map will be inserted in the PurchOrdr table in an Oracle database defined by the RemoteDB connect string. The logon, user ID, and password settings are retrieved from an input card named Profile.

For information about using the RUN, GET and PUT functions, refer to the Functions and Expressions documentation.