17.10 - Loading to a Database Using BTEQ - Access Module

Teradata® Tools and Utilities Access Module Reference

Product
Access Module
Release Number
17.10
Published
October 2021
Language
English (United States)
Last Update
2021-11-02
dita:mapPath
uur1608578381725.ditamap
dita:ditavalPath
obe1474387269547.ditaval
  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 Teradata Access Module for OLE DB.
    "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;