-2

我正在使用 Teradata 的 SQL 助手将数据加载到表中。文件具有具有相同布局的匹配列。关于为什么这会完成导入但不会将任何数据插入表中的任何想法?

这是表和插入的 SQL...

CREATE MULTISET TABLE DLAB_MARKETING.ProfileAttributes,
NO FALLBACK,
NO BEFORE JOURNAL,
     NO AFTER JOURNAL,
     CHECKSUM = DEFAULT,
     DEFAULT MERGEBLOCKRATIO
     (
      FullName VARCHAR(50) CHARACTER SET LATIN NOT CASESPECIFIC NOT NULL,
      EmailAddress VARCHAR(100) CHARACTER SET LATIN NOT CASESPECIFIC NOT NULL,
      FirstName VARCHAR(100) CHARACTER SET LATIN NOT CASESPECIFIC,
      LastName VARCHAR(100) CHARACTER SET LATIN NOT CASESPECIFIC,
      ZipCode INTEGER,
      StoreNumber INTEGER,
      StoreAddress VARCHAR(100) CHARACTER SET LATIN NOT CASESPECIFIC,
      StoreCity VARCHAR(100) CHARACTER SET LATIN NOT CASESPECIFIC,
      StoreState CHAR(2) CHARACTER SET LATIN NOT CASESPECIFIC,
      StoreZip INTEGER,
      State VARCHAR(25) CHARACTER SET LATIN NOT CASESPECIFIC NOT NULL,
      Source_ VARCHAR(75) CHARACTER SET LATIN NOT CASESPECIFIC NOT NULL,
      PhoneNumber INTEGER,
      Address1 VARCHAR(150) CHARACTER SET LATIN NOT CASESPECIFIC,
      Address2 VARCHAR(150) CHARACTER SET LATIN NOT CASESPECIFIC,
      City VARCHAR(100) CHARACTER SET LATIN NOT CASESPECIFIC,
      Gender CHAR(1) CHARACTER SET LATIN NOT CASESPECIFIC,
      MobilePhone INTEGER,
      CR2StoreIntersection INTEGER,
      CR2StoreCity VARCHAR(100) CHARACTER SET LATIN NOT CASESPECIFIC,
      Pet INTEGER,
      ShoppingFrequency INTEGER,
      AgeToddler INTEGER,
      AgeChildren6to17 INTEGER,
      Age25To34 INTEGER,
      Age18To24 INTEGER,
      Age35To44 INTEGER,
      Age45To54 INTEGER,
      AdultApparel INTEGER,
      Age55To64 INTEGER,
      Age65orGreater INTEGER,
      Dog INTEGER,
      Cat INTEGER,
      Groceries INTEGER,
      Snacks INTEGER,
      Cleaning INTEGER,
      Q4NoAnswer INTEGER,
      AgeInfant INTEGER,
      HBA INTEGER,
      Baby INTEGER,
      ChildrenClothing INTEGER,
      Housewares INTEGER,
      Party INTEGER,
      Seasonal INTEGER,
      Toys INTEGER,
      SchoolSupplies INTEGER,
      Cellular INTEGER,
      General INTEGER,
      Ad INTEGER,
      Survey INTEGER,
      Coupon INTEGER,
      Contest INTEGER,
      White INTEGER,
      AA INTEGER,
      AmericanIndian INTEGER,
      Asian INTEGER,
      Hawaiian INTEGER,
      Hispanic INTEGER,
      Other INTEGER,
      Q6NoAnswer INTEGER,
      CR2StoreNumber INTEGER,
      HTMLEmails VARCHAR(100) CHARACTER SET LATIN NOT CASESPECIFIC,
      SubscriberKey VARCHAR(125) CHARACTER SET LATIN NOT CASESPECIFIC,
      Status VARCHAR(50) CHARACTER SET LATIN NOT CASESPECIFIC NOT NULL)
PRIMARY INDEX ( EmailAddress );

INSERT  INTO DLAB_MARKETING.ProfileAttributes
(FullName, EmailAddress, FirstName, LastName, ZipCode, StoreNumber,
        StoreAddress, StoreCity, StoreState, StoreZip, State, Source_,
        PhoneNumber, Address1, Address2, City, Gender, MobilePhone, CR2StoreIntersection,
        CR2StoreCity, Pet, ShoppingFrequency, AgeToddler, AgeChildren6to17,
        Age25To34, Age18To24, Age35To44, Age45To54, AdultApparel, Age55To64,
        Age65orGreater, Dog, Cat, Groceries, Snacks, Cleaning, Q4NoAnswer,
        AgeInfant, HBA, Baby, ChildrenClothing, Housewares, Party, Seasonal,
        Toys, SchoolSupplies, Cellular, General, Ad, Survey, Coupon,
        Contest, White, AA, AmericanIndian, Asian, Hawaiian, Hispanic,
        Other, Q6NoAnswer, CR2StoreNumber, HTMLEmails, SubscriberKey,
        Status)

VALUES  
(?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?,
        ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?,
        ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?,
        ?)
4

1 回答 1

1

如果您的连接的事务语义默认为 ANSI 而不是 Teradata,您将需要在声明COMMIT;之后提交INSERT

要检查会话的事务语义:

  1. 连接到 Teradata
  2. HELP SESSION;
  3. 寻找事务语义。它将是 Teradata 或 ANSI。

您还可以在 ODBC DSN 配置中指定事务语义。

于 2012-08-14T17:02:17.507 回答