Teradata导入错误 - 导入完成但没有数据插入列

时间:2012-08-13 14:55:21

标签: sql teradata

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

这是表格和插入的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  
(?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?,
        ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?,
        ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?,
        ?)

1 个答案:

答案 0 :(得分:1)

如果您的连接的事务语义默认为ANSI而非Teradata,则需要在COMMIT;语句后提交INSERT

检查会话的事务语义:

  1. 连接到Teradata
  2. HELP SESSION;
  3. 查找事务语义。它将是Teradata或ANSI。
  4. 您还可以在ODBC DSN配置中指定事务语义。