我的控制文件中有多个 when 子句,其中一半加载的数据满足 when 子句并插入到所需的表中。另一半不是(我期望的),但我期望将不满足何时条件的数据放入丢弃文件中,但没有创建。
有任何想法吗?
LOAD DATA
INFILE '/u04/app/vpht_app/flat_files/icr_load/marc/sqlldr_load/CSSO_CCRBSCREDENTIALS_COMSUMER23062010160322.txt'
BADFILE '/u04/app/vpht_app/flat_files/icr_load/marc/sqlldr_load/CSSO_CCRBSCREDENTIALS_COMSUMER23062010160322.bad'
DISCARDFILE '/u04/app/vpht_app/flat_files/icr_load/marc/sqlldr_load/CSSO_CCRBSCREDENTIALS_COMSUMER23062010160322.dsc'
INSERT
INTO TABLE "DCVPAPP"."RBS_CC_CUSTOMERINFO"
INSERT
FIELDS TERMINATED BY ','
TRAILING NULLCOLS
(CC_USER_NAME POSITION(24:73),
ACCOUNTID POSITION(1:12),
CUSTOMERID POSITION(14:22))
INTO TABLE "DCVPAPP"."RBS_CC_SECURITYDETAILS"
WHEN (481:481) = 'N' AND (477:479) ='0'
FIELDS TERMINATED BY ','
TRAILING NULLCOLS
(
CC_USER_NAME POSITION(24:73),
RBSPIN POSITION(75:274),
RBSPASSWORD POSITION(276:475),
fill1 filler,
fill2 filler,
fill3 filler,
fill4 filler,
FAILCODECOUNT POSITION(477:479),
FAILPASSWORDCOUNT POSITION(477:479)
)
INTO TABLE "DCVPAPP"."RBS_CC_SECURITYDETAILS"
WHEN (481:481) = 'N' AND (477:479) ='1'
FIELDS TERMINATED BY ','
TRAILING NULLCOLS
(
CC_USER_NAME POSITION(24:73),
RBSPIN POSITION(75:274),
RBSPASSWORD POSITION(276:475),
fill1 filler,
fill2 filler,
fill3 filler,
fill4 filler,
FAILCODECOUNT POSITION(477:479),
FAILPASSWORDCOUNT POSITION(477:479)
)
我的表结构是:
Create table RBS_CC_CUSTOMERINFO
(
CC_USER_NAME VARCHAR2(50),
ACCOUNTID VARCHAR2(12) NOT NULL,
CUSTOMERID VARCHAR2(9) NOT NULL,
CUST_MIGRATION_STATUS VARCHAR2(1) DEFAULT 'N' NOT NULL,
CONSTRAINT pk_01 PRIMARY KEY (CC_USER_NAME)
);
Create table RBS_CC_SECURITYDETAILS
(
CC_USER_NAME VARCHAR2(50),
RBSPIN VARCHAR2(200) NOT NULL,
RBSPASSWORD VARCHAR2(200) NOT NULL,
FAILCODECOUNT NUMBER (9) NOT NULL,
FAILPASSWORDCOUNT NUMBER (9) NOT NULL,
CONSTRAINT pk_secur
FOREIGN KEY (CC_USER_NAME)
REFERENCES RBS_CC_CUSTOMERINFO(CC_USER_NAME)
)
我的示例数据在下面(这些已被正确填充,因为这些是固定字段)最后一条记录应该被丢弃并放在丢弃文件中,因为它不满足任何 when 子句条件,但没有创建丢弃文件。我已经尝试使用一个 when 子句并创建了丢弃文件,似乎使用了多个表而没有创建丢弃文件。
ACC000000001,CUSTID213,MARC_VAF ,1234 ,宠物 ,0 ,N,N,FULL ACC000000002,CUSTID214,TOBY_123,1352,贝利,1,Y,N,FULL ACC000000003,CUSTID215,KEVIN_VAF81,YY33OF,水,2,Y,N,FULL ACC000000015,CUSTID227,SAM_EGD,CARRY42,一些密码,-3,Y,N,FULL
谢谢