All Forums Tools
chill3che 99 posts Joined 10/12
02 Feb 2014
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 '<'."

 

Thanks, Cheeli
Ivyuan 63 posts Joined 01/10
03 Feb 2014

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.

chill3che 99 posts Joined 10/12
04 Feb 2014

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

Thanks,
Cheeli

chill3che 99 posts Joined 10/12
06 Feb 2014

Hi Experts,
Looking for some help on this...
After this, I can move on exploring Mload utility.
 

Thanks,
Cheeli

feinholz 1234 posts Joined 05/08
06 Feb 2014

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

chill3che 99 posts Joined 10/12
07 Feb 2014

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)

Thanks,
Cheeli

sgarlapa 88 posts Joined 03/13
07 Feb 2014

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.

feinholz 1234 posts Joined 05/08
07 Feb 2014

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

You must sign in to leave a comment.