All Forums Tools
11 May 2015
FASTLOAD Date format issue

Hello Team,
could you please help me on below issue with date formate at Define statement of FL

.LOGON 127.0.0.1/TDUSER,TDUSER

 

DROP TABLE SAMPLES.EMP_PERS;

 

 

CREATE TABLE SAMPLES.EMP_PERS

(EMP_ID INTEGER NOT NULL

,EMP_NAME VARCHAR(50)

,SALARY INTEGER

,DEPT_ID VARCHAR(20)

,LOC  VARCHAR(20)

,DOB DATE

,SSN INTEGER

)

 UNIQUE PRIMARY INDEX(EMP_ID) ;

 

BEGIN LOADING 

SAMPLES.EMP_PERS

ERRORFILEs SAMPLES.EMP_ERR1,SAMPLES.EMP_ERR2 ;

 

SET RECORD VARTEXT "~" ;

 

DEFINE 

EMP_ID (VARCHAR(9))

,EMP_NAME (VARCHAR(50))

,SALARY (VARCHAR(9))

,DEPT_ID (VARCHAR(20))

,LOC (VARCHAR(50))

,DOB (varchar, FORMAT 'MM/DD/YYYY')

,SSN (VARCHAR(20))

 

FILE= C:\Users\Sridhar\Desktop\teradata\BTEQ Scripts Outputs\FL1.txt;

 

INSERT INTO SAMPLES.EMP_PERS

(:EMP_ID

,:EMP_NAME

,:SALARY

,:DEPT_ID

,:LOC

,:DOB 

,:SSN

 

);

 

END LOADING;

LOGOFF;
 
Error Message :- Defination syntax error for DOB field .
 
 

Sridhar Esampalli
Fred 1096 posts Joined 08/04
13 May 2015

You need to do the cast in the INSERT, not in the DEFINE. Change these two lines
 
,DOB (VARCHAR(10))
 
,:DOB (DATE, FORMAT 'MM/DD/YYYY')

You must sign in to leave a comment.