Hi,
I am trying to run Mload to populate data from a flat file (load ready file)using a control file to teradata i have a shell script that runs the mload
when i run the script all the records go into the error table and all is see is ? marks for all the fields the data file had 58 records the ET table in teradata also has 58 records but it does not contain the proper data
rather all the columns just show ? for all the records. I checked the Load data file it has the right data for 58 records. would really appreicate ur help!!
Part of my Ctl file for Mload is as below:
.BEGIN IMPORT MLOAD
TABLES awe_mkt_avt
WORKTABLES &TRGT_DBE.WORK.UV_awe_mkt_avt
ERRORTABLES &TRGT_DBE.WORK.WT_awe_mkt_avt
&TRGT_DBE.WORK.ET_awe_mkt_avt
ERRLIMIT 1000
CHECKPOINT 0
TENACITY 2
SESSIONS 8
SLEEP 6 ;
/* Begin Layout Section */
.Layout INPUTLAYOUT;
.Field awe_mkt_id * VARCHAR( 20) ;
.Field awe_mkt_tech_cat_cd * VARCHAR( 20) ;
.Field awe_mkt_cd * VARCHAR( 20) ;
.Field awe_mkt_desc * VARCHAR( 100) ;
.Field rec_crtn_dt_tm * VARCHAR( 26) ;
.Field load_dt_tm * VARCHAR( 26) ;
.Field updt_dt_tm * VARCHAR( 26) ;
.DML LABEL UPSERTS
Do insert for missing update rows;
UPDATE awe_mkt_avt
SET
awe_mkt_tech_cat_cd = :awe_mkt_tech_cat_cd ,
awe_mkt_cd = :awe_mkt_cd ,
awe_mkt_desc = :awe_mkt_desc ,
rec_crtn_dt_tm = CASTrec_crtn_dt_tm as TIMESTAMP(0)) ,
load_dt_tm = CASTload_dt_tm as TIMESTAMP(0)),
updt_dt_tm = CASTupdt_dt_tm as TIMESTAMP(0))
WHERE
awe_mkt_id = :awe_mkt_id
;
INSERT INTO awe_mkt_avt (
awe_mkt_id ,
awe_mkt_tech_cat_cd ,
awe_mkt_cd ,
awe_mkt_desc ,
rec_crtn_dt_tm ,
load_dt_tm ,
updt_dt_tm
) VALUES (
:awe_mkt_id ,
:awe_mkt_tech_cat_cd ,
:awe_mkt_cd ,
:awe_mkt_desc ,
CASTrec_crtn_dt_tm as TIMESTAMP(0) ) ,
CASTload_dt_tm as TIMESTAMP(0)) ,
CASTupdt_dt_tm as TIMESTAMP(0))
) ;
.IMPORT INFILE &DATA_DIR./&LOADFILE
LAYOUT INPUTLAYOUT
FORMAT VARTEXT '|'
APPLY UPSERTS
;
.END MLOAD;
.LOGOFF;
I am trying to run Mload to populate data from a flat file (load ready file)using a control file to teradata i have a shell script that runs the mload
when i run the script all the records go into the error table and all is see is ? marks for all the fields the data file had 58 records the ET table in teradata also has 58 records but it does not contain the proper data
rather all the columns just show ? for all the records. I checked the Load data file it has the right data for 58 records. would really appreicate ur help!!
Part of my Ctl file for Mload is as below:
.BEGIN IMPORT MLOAD
TABLES awe_mkt_avt
WORKTABLES &TRGT_DBE.WORK.UV_awe_mkt_avt
ERRORTABLES &TRGT_DBE.WORK.WT_awe_mkt_avt
&TRGT_DBE.WORK.ET_awe_mkt_avt
ERRLIMIT 1000
CHECKPOINT 0
TENACITY 2
SESSIONS 8
SLEEP 6 ;
/* Begin Layout Section */
.Layout INPUTLAYOUT;
.Field awe_mkt_id * VARCHAR( 20) ;
.Field awe_mkt_tech_cat_cd * VARCHAR( 20) ;
.Field awe_mkt_cd * VARCHAR( 20) ;
.Field awe_mkt_desc * VARCHAR( 100) ;
.Field rec_crtn_dt_tm * VARCHAR( 26) ;
.Field load_dt_tm * VARCHAR( 26) ;
.Field updt_dt_tm * VARCHAR( 26) ;
.DML LABEL UPSERTS
Do insert for missing update rows;
UPDATE awe_mkt_avt
SET
awe_mkt_tech_cat_cd = :awe_mkt_tech_cat_cd ,
awe_mkt_cd = :awe_mkt_cd ,
awe_mkt_desc = :awe_mkt_desc ,
rec_crtn_dt_tm = CASTrec_crtn_dt_tm as TIMESTAMP(0)) ,
load_dt_tm = CASTload_dt_tm as TIMESTAMP(0)),
updt_dt_tm = CASTupdt_dt_tm as TIMESTAMP(0))
WHERE
awe_mkt_id = :awe_mkt_id
;
INSERT INTO awe_mkt_avt (
awe_mkt_id ,
awe_mkt_tech_cat_cd ,
awe_mkt_cd ,
awe_mkt_desc ,
rec_crtn_dt_tm ,
load_dt_tm ,
updt_dt_tm
) VALUES (
:awe_mkt_id ,
:awe_mkt_tech_cat_cd ,
:awe_mkt_cd ,
:awe_mkt_desc ,
CASTrec_crtn_dt_tm as TIMESTAMP(0) ) ,
CASTload_dt_tm as TIMESTAMP(0)) ,
CASTupdt_dt_tm as TIMESTAMP(0))
) ;
.IMPORT INFILE &DATA_DIR./&LOADFILE
LAYOUT INPUTLAYOUT
FORMAT VARTEXT '|'
APPLY UPSERTS
;
.END MLOAD;
.LOGOFF;