16.10 - Loading to Teradata Database Using BTEQ - Access Module

Teradata Tools and Utilities Access Module Reference

prodname
Access Module
vrm_release
16.10
created_date
July 2017
category
Programming Reference
featnum
B035-2425-077K
  1. Select Start > Programs > Teradata Client > BTEQ to open Teradata BTEQ from the Windows desktop.
  2. Use the IMPORT command to specify the following:
    FILE Parameter Operating Specification Outcome
    "<pathame>.amj" 'noprompt' Script runs if no errors exist. If errors exist, the script fails.
    "<pathame>.amj" '<blank>' The Teradata OLE DB AXSMOD dialog box appears so you can run the script using the access module.
    "UNTITLED" 'noprompt' Script fails. Instead, specify an .amj file name instead of UNTITLED.
    "UNTITLED" '<blank>' The Teradata OLE DB AXSMOD dialog box appears.

Example: BTEQ Load

.LOGON bubbater/dbc,dbc;
database bubba ;
drop table "Customers";
CREATE TABLE "Customers" (CustomerID CHAR(5) NOT NULL,
      CompanyName VARCHAR(40) NOT NULL,
      ContactName VARCHAR(30),
      ContactTitle VARCHAR(30),
      Address VARCHAR(60),
      City VARCHAR(15),
      Region VARCHAR(15),
      PostalCode VARCHAR(10),
      Country VARCHAR(15),
      Phone VARCHAR(24),
      Fax VARCHAR(24));
.IMPORT indicdata file="C:\mload.amj" AXSMOD OLEDB_AXSMOD 'noprompt';
.REPEAT *using (CustomerID CHAR(5),
      CompanyName VARCHAR(40),
      ContactName VARCHAR(30),
      ContactTitle VARCHAR(30),
      Address VARCHAR(60),
      City VARCHAR(15),
      Region VARCHAR(15),
      PostalCode VARCHAR(10),
      Country VARCHAR(15),
      Phone VARCHAR(24),
      Fax VARCHAR(24))
   INSERT INTO "Customers"(
      CustomerID, CompanyName,
      ContactName, ContactTitle,
      Address, City,
      Region, PostalCode,
      Country, Phone,
      Fax)
VALUES(
      :CustomerID, :CompanyName,
      :ContactName, :ContactTitle,
      :Address, :City,
      :Region, :PostalCode,
      :Country, :Phone,
      :Fax);
.LOGOFF;
.QUIT;