Mload - execute a file in batch mode, invalid statement was found

Tools
Enthusiast

Mload - execute a file in batch mode, invalid statement was found

Greetings Experts,

I am using windows 7, TD 13.0 express demo version on my laptop.  I have created the sample Mload file in C:\mload_in.txt which is below.

.LOGTABLE SAMPLES.ML_ITEMPPI;
.logon localtd/tduser,tduser;

.begin import mload tables samples.itemppi;
--errortables samples.ET_ITEMPPI SAMPLES.UV_ITEMPPI SAMPLES.WT_ITEMPPI;

.LAYOUT DATA_LAYOUT;
.field L_ORDERKEY * INTEGER;
.field L_PARTKEY * INTEGER;
.field L_QUANTITY * DECIMAL (15,2);
.field L_LINESTATUS * CHAR(1);
.field L_SHIPDATE * DATE;

.dml label insert_itemppi;
insert into samples.itemppi.*;
-- values (:L_ORDERKEY, :L_PARTKEY, :L_QUANTITY, :L_LINESTATUS, :L_SHIPDATE);

.import infile "C:\itemppi_data.txt"
format fastload
layout data_layout
apply insert_itemppi;
.end mload;

.logoff;

When I click on Mload utility and type

mload < C:\mload_in.txt

it is showing the error message as 

"**** 12:59:28 UTY2403 An invalid statement was found before the .LOGTABLE statement.

**** 12:59:28 UTY2400 Error received in interactive mode will be ignored."

Also tried to use the following command, resulting in the same error

mload -r '.RUN FILE C:\mload_in.txt;'

how to execute the above file in batch mode?

I also tried to execute the same mload statements in bteqwin with no luck.  Error message is

"*** Failure 3707 Syntax error, expected something like a name or a Unicode 

 delimited identifier between the 'mload' keyword and '<'."

7 REPLIES
Teradata Employee

Re: Mload - execute a file in batch mode, invalid statement was found

Hi Cheeli,

Can you try changing the following statements

--errortables samples.ET_ITEMPPI SAMPLES.UV_ITEMPPI SAMPLES.WT_ITEMPPI;

-- values (:L_ORDERKEY, :L_PARTKEY, :L_QUANTITY, :L_LINESTATUS, :L_SHIPDATE);

to

/*errortables samples.ET_ITEMPPI SAMPLES.UV_ITEMPPI SAMPLES.WT_ITEMPPI*/;

/*values (:L_ORDERKEY, :L_PARTKEY, :L_QUANTITY, :L_LINESTATUS, :L_SHIPDATE)*/;

to see what heppens?

Thanks!

--Ivy.

Enthusiast

Re: Mload - execute a file in batch mode, invalid statement was found

Hi Ivy,

Tried with the changes as mentioned by you.  It's still failing with same issue.

However, I believe that there is no issue in the script.  I am unable to execute the script in a batch mode when using the following commands in both BTEQWIN and MLOAD applications. (The file mload_in.txt has the script)  

mload < C:\mload_in.txt;

mload -r '.RUN FILE C:\mload_in.txt;';

I have also tried to enclose the file name in double quotes.  It's still failing.

However, I tried to execute the statements in the script interactively in Mload application and it successfully completed.  Can you please help me how to execute them in batch mode

Enthusiast

Re: Mload - execute a file in batch mode, invalid statement was found

Hi Experts,

Looking for some help on this...

After this, I can move on exploring Mload utility.

Teradata Employee

Re: Mload - execute a file in batch mode, invalid statement was found

What do you mean by "When I click on Mload utility"?

What happens if you remove the trailing semicolon from this (not sure why you put it there):

mload < C:\mload_in.txt;

-- SteveF
Enthusiast

Re: Mload - execute a file in batch mode, invalid statement was found

Hi Steven,

After launching "Teradata Multiload" client, I am running the following commands.

mload < C:\mload_in.txt

When I press enter, the client is still not running the command ( maybe it is expecting that the command is not complete) and hence I specified the semicolon.

I have tried to enclose the file path in double quotes and tried and even this doesn't work.

Also tried to execute the following command and still failing

mload -r '.RUN FILE C:\mload_in.txt;'

tried to run the above command using double quotes, removing semicolon inside the colons.  But still facing the same error as "**** 12:59:28 UTY2403 An invalid statement was found before the .LOGTABLE statement.

**** 12:59:28 UTY2400 Error received in interactive mode will be ignored."

However, I am able run the statements in the script successfully (interactively in teradata multiload)

Enthusiast

Re: Mload - execute a file in batch mode, invalid statement was found

In the demo version of TD 13.0 use below process.

start->run->type 'cmd'  ==> gives you dos command prompt.

At the prompt use your mload command such as -

c:\> mload < pathofmloadfile >logfilename 2>&1

It should work.

when you directly click on mload utility it start with interactive mode only then you have to type ctr+c and they at the prompt use the above command.

Teradata Employee

Re: Mload - execute a file in batch mode, invalid statement was found

Have you tried running "mload" from the command line prompt (NOT from clicking on the mload utility)?

Also, you cannot use the wildcard syntax on the INSERT statement because you did not use the .TABLE command.

Change your DML statement to:

insert into samples.itemppi values (:L_ORDERKEY, :L_PARTKEY, :L_QUANTITY, :L_LINESTATUS, :L_SHIPDATE);

 

-- SteveF