Using the odbctest utility

The odbctest utility allows you to test Open DataBase Connectivity (ODBC) connections to a target database and, once connected, to issue a variety of commands.

About this task

This utility is supported on AIX®, Solaris, Windows, and HP-UX systems (32-bit only). For Oracle and DB2® databases, use their native utilities.

Procedure

  1. From a command prompt on the Unica Campaign server, run the odbctest utility.

    The utility returns a list of databases that you can connect to, similar to the following:

    Registered Data Sources:
    		MS Access Database (Microsoft Access Driver (*.mdb))
    		dBASE Files (Microsoft dBase Driver (*.dbf))
    		Excel Files (Microsoft Excel Driver (*.xls))
  2. Enter the following information exactly at the prompts:
    1. The name of the database that you want to connect to (taken from the list of Registered Data Sources)
    2. A database user ID
    3. The password associated with the database user ID

    The utility does not prompt for confirmation of your selections.

  3. When you have successfully connected to the database, the utility prints out messages like the following and presents you with a command prompt:
    Server ImpactDemo conforms to LEVEL 1.
    Server's cursor commit behavior: CLOSE
    Transactions supported: ALL
    Maximum number of concurrent statements: 0
    For a list of tables, use PRINT.
  4. You can enter the following commands at the prompt:
    • bulk [number_of_records]

      Sets the number of records to return, as specified by number_of_records. The default is 1.

    • descresSQL_command

      Describes the columns returned by the SQL command specified by SQL_command.

    • describepattern

      Describes the table or tables specified by pattern. Returns the corresponding type, data type, storage length, precision, and scale.

    • exit

      Terminates the database connection and exits.

    • help

      Displays a list of supported commands.

    • print[pattern]

      Returns a list of tables. Can optionally specify a search pattern.

    • quit

      Terminates the database connection and exits.

    • SQL_command

      Executes any valid SQL command or series of SQL commands.

    • typeinfo

      Returns a list of supported data types for the database.