Problem with Fast Load script

Tools & Utilities
Fan

Problem with Fast Load script

Hello,

I am trying to create a new table in my Teradata database and then insert data in it proceding from another table.  The script I use is the following :

ERRLIMIT 25

DATABASE XXXXXX;

SET RECORD VARTEXT ";";

DROP TABLE XXXXXX.YYYYYY;

CREATE MULTISET TABLE XXXXXX.YYYYYY,

NO FALLBACK ,

NO BEFORE JOURNAL,

NO AFTER JOURNAL,

CHECKSUM = DEFAULT,

DEFAULT MERGEBLOCKRATIO(

date_utc VARCHAR(20),

heure_utc VARCHAR(8),

last_technology VARCHAR(15) CHARACTER SET LATIN NOT CASESPECIFIC COMPRESS ('2G','3G','4G','4G+','WIFI','UNKNOWN'),

IMEI VARCHAR(100),

PRIMARY INDEX (IMEI);

DROP TABLE XXXXXX.YYYYYY_FASTERR1;

DROP TABLE XXXXXX.YYYYYY_FASTERR2;

BEGIN LOADINGXXXXXX.YYYYYY ERRORFILES XXXXXX.YYYYYY_FASTERR1, XXXXXX.YYYYYY_FASTERR2;

INSERT into XXXXXX.YYYYYY

SELECT SUBSTR ( DATE_UTC, 1,10) AS DATE_UTC,

SUBSTR ( DATE_UTC, 11,8) AS HEURE_UTC,

LAST_TECHNOLOGY,

IMEI

FROM XXXXXX.ZZZZZZ;

END LOADING;

.logoff;

The problem is that I get the following error message :

**** 15:42:19 FDL4814 Failure due to no input file specified

**** 15:42:19 DEFINE statement must be issued before INSERT

and I don't understand it, as I am not inserting data from a CSV file but from another table.

Is there a solution to correct this error ?

Thank you for any help.

3 REPLIES
Junior Contributor

Re: Problem with Fast Load script

You don't need FastLoad as the source is an existing table. Simply use a SQL Insert/Select instead:

DROP TABLE XXXXXX.YYYYYY;

CREATE MULTISET TABLE XXXXXX.YYYYYY,
NO FALLBACK ,
NO BEFORE JOURNAL,
NO AFTER JOURNAL,
CHECKSUM = DEFAULT,
DEFAULT MERGEBLOCKRATIO(
date_utc VARCHAR(20),
heure_utc VARCHAR(8),
last_technology VARCHAR(15) CHARACTER SET LATIN NOT CASESPECIFIC COMPRESS ('2G','3G','4G','4G+','WIFI','UNKNOWN'),
IMEI VARCHAR(100),
PRIMARY INDEX (IMEI);

INSERT into XXXXXX.YYYYYY
SELECT SUBSTR ( DATE_UTC, 1,10) AS DATE_UTC,
SUBSTR ( DATE_UTC, 11,8) AS HEURE_UTC,
LAST_TECHNOLOGY,
IMEI
FROM XXXXXX.ZZZZZZ;
Fan

Re: Problem with Fast Load script

Thank you for your answer.

Do you mean I don't even need to use BTEQ ? Is it possible to directly execute SQL statements without any Teradata tool ?

Teradata Employee

Re: Problem with Fast Load script

To answer your original question, the error in FastLoad occurred because you did not have a DEFINE statement in the script.

FastLoad is used (primarily) to load data from a flat file into Teradata.

FastLoad cannot be used to copy data from one Teradata table to another (TPT can do this).

As for an INS-SEL there are several tools from which you can execute that SQL request.

-- SteveF