Fast load Issue

Tools

Fast load Issue

Hi experts, this is the error I got while executing the fastload script

0002 .logon 127.0.0.1/dbc,

**** 16:43:30 Teradata Database Release: 14.10.01.02

**** 16:43:30 Teradata Database Version: 14.10.01.01

**** 16:43:30 Number of AMPs available: 2

**** 16:43:30 Current CLI or RDBMS allows maximum row size: 64K

**** 16:43:30 Character set for this job: ASCII

0003 set record vartext ",";

**** 16:43:30 Now set to read 'Variable-Length Text' records

**** 16:43:30 Delimiter character(s) is set to ','

**** 16:43:30 Command completed successfully

0004 begin loading retail.employee;

**** 16:43:30 Number of FastLoad sessions requested = 4

**** 16:43:30 Number of FastLoad sessions connected = 2

**** 16:43:30 FDL4808 LOGON successful

**** 16:43:30 RDBMS error 3706: Syntax error: expected something

              between the word 'employee' and the 'WITH' keyword.

     ===================================================================

     =                                                                 =

     =          Logoff/Disconnect                                      =

     =                                                                 =

     ===================================================================

**** 16:43:30 Logging off all sessions

**** 16:43:30 Total processor time used = '0.27 Seconds'

     .        Start : Sat Nov 21 16:43:30 2015

     .        End   : Sat Nov 21 16:43:30 2015

     .        Highest return code encountered = '12'.

**** 16:43:30 FDL4818 FastLoad Terminated

TDExpress14.10.01_Sles10:~ #

The script that i used is as follows

.sessions 4;

.logon 127.0.0.1/dbc,dbc;

set record vartext ",";

begin loading retail.employee;

define 

Empno (varchar(15))

Empname (varchar(18))

Address (varchar(40))

Phone (varchar(15))

Deptno (varchar(2))

Salary (varchar(12))

YrsExp (varchar(1))

DOB (varchar(10))

Medstat (varchar(1))

Edllev (varchar(1))

Note (varchar(79))

File = Incoming.txt;

Insert into retail.employee

values(

:Empno,

:Empname,

:Address,

:Phone,

:Deptno,

:Salary,

:YrsExp,

:DOB,

:Medstat,

:Edllev,

:Note

);

end loading;

.logoff;

can somebody please help me to figure out the mistake.. please.. please.. please..

8 REPLIES
Junior Supporter

Re: Fast load Issue

Hi.

Commas missing after field definitions in the DEFINE section.

HTH

Cheers.

Carlos.

Teradata Employee

Re: Fast load Issue

You will need the commas also, but didn't even get that far.

While the reference to "'WITH' keyword" is confusing, the 3706 error is because your BEGIN LOADING command does not include the required ERRORFILES table1, table2 clause

Junior Supporter

Re: Fast load Issue

Fred:

Yup. Of course you're right. I overlooked the ERRORFILES part.

Cheers.

Carlos.

Re: Fast load Issue

Thank you for your help.. It worked... :) Can you please help me with some other issues. If my file includes column header names how do i skip them so that they will not be loaded into my database. Also, is there any way i can concatenate two or more fields from my file and load it into the database with fastload. Example;

File structure:

Empno, Efirstname, Emiddlename, Elastname, Deptno

Database structure:

Empno, Ename, Deptno

(Would I be able to concatenate first,middle, and last name field in the fastload script and load it to the ename field in my database)

Thank you for your help in advance.. :)

Teradata Employee

Re: Fast load Issue

You can use RECORD 2; command to skip the first record.

FastLoad does not allow you to concatenate the fields or extract part of a field. You can ignore fields from the input record, but can only insert a field to a column (or substitute NULL, using NULLIF clause).

Re: Fast load Issue

Thank you Fred.. :)

Teradata Employee

Re: Fast load Issue

I could be wrong but I do not think the RECORD command will work with header rows.

FastLoad expects every row to have the same format, so the header rows would have to be in the same format as the data rows (which does not always happen).

TPT, on the other hand, will just blindly read until the EOR when skipping rows and not care about the content of the row. TPT can also perform concatenation of columns.

-- SteveF
Enthusiast

Re: Fast load Issue

if you are using UNIX/LINUX to run script, then use can easily remove the 1st record or last records using sed