I am trying to load a table using the below MLOAD script:
.LOGTABLE tduser.Logtable; .LOGON host/user,password; .BEGIN MLOAD TABLES Employee_Stg; .LAYOUT Employee; .FIELD in_EmployeeNo * INTEGER; .FIELD in_FirstName * VARCHAR(30); .FIELD in_LastName * VARCHAR(30); .FIELD in_BirthDate * VARCHAR(30); .FIELD in_JoinedDate * VARCHAR(30); .FIELD in_DepartmentNo * VARCHAR(10); .DML LABEL EmpLabel; INSERT INTO Employee_Stg ( EmployeeNo, FirstName, LastName, BirthDate, JoinedDate, DepartmentNo ) VALUES ( :in_EmployeeNo, :in_FirstName, :in_Lastname, :in_BirthDate, :in_JoinedDate, :in_DepartmentNo ); .IMPORT INFILE employee.txt FORMAT VARTEXT ',' LAYOUT Employee APPLY EmpLabel; .END MLOAD; LOGOFF;
The table is created as below:
Create table Employee_Stg
The sample data is created using a TEXT editor NOTEPAD++
When I try to execute this script it is throwing error as
"The Type for field EmployeeNo is not supported for vartext format"
i have tried using other formats like FASTLOAD but it did not solve the problem.My source is comma separated text file.
Could anyone suggest any workaround for this since the field will be integer.
Thanks for the inputs.Declaring the data types as varchar and casting it to the respective data Integer/date type works fine.