All Forums Teradata Applications
12 Mar 2016
M-load Error while executing script

Hi All,
 
When executing the below script for MLOADm getting the below error:
 
output:
$ ./multiload.sh
./multiload.sh: .LOGTABLE:  not found.
./multiload.sh[2]: .logon:  not found.
./multiload.sh[4]: .begin:  not found.
./multiload.sh[5]: .layout:  not found.
./multiload.sh[6]: 0403-057 Syntax error at line 6 : `(' is not expected.
 
======= Script Starts Here===============
Multiload.sh:
 
.logtable ETLT5.INFA_SOURCE12_LOG
.logon ttdbia/a0c9sx,blue@126;
drop table ETLT5.INFA_SOURCE12_ET
 drop table ETLT5.INFA_SOURCE12_UT
 drop table ETLT5.INFA_SOURCE12_UV
 drop table ETLT5.INFA_SOURCE12_WT
.begin import mload tables ETLT5.INFA_SOURCE12 SESSIONS 20;
.layout InputFile_layout;
 .field id * varchar(10);
 .field Name * varchar(20);
 .field country * varchar(30);
.dml label Table_InsertDML;
.insert into ETLT5.INFA_SOURCE12
 (
id
 ,Name
 ,country 
 
 )
 values
 (
:id
 :,Name
 :,country 
 );
.import infile /nas/infred/data/SrcFiles/fastload.txt
 format vartext  ','
 display errors
 nostop
 layout InputFile_Layout
 apply Table_InsertDML;
.end mload;
 .logoff;
 
Please help me in this .Thanks in Advance :)
 

12 Mar 2016

Please help me guys !!

dnoeth 4628 posts Joined 11/04
13 Mar 2016

Each MLoad command must be preceded by a period and must end with a semicolon.
Each Teradata SQL command must not be preceded by a period and must end with a semicolon.

Dieter

13 Mar 2016

Thanx Dnoeth,
changed my script according to what you have mentioned but stiil facing the same errors.

dnoeth 4628 posts Joined 11/04
13 Mar 2016

Show your exact script and how you call it on command line.

Dieter

13 Mar 2016

Here my MLOAD Script (mulitload.sh):
.LOGTABLE ETLT5.LOG_INFA;
.logon ttdbia/a0c9sx,blue@126;
.begin import mload tables ETLT5.INFA_SOURCE12 ;
.layout InputFile_layout;
.field id * varchar(10);
.field Name * varchar(20);
.field country * varchar(30);
.dml label Table_InsertDML;
insert into ETLT5.INFA_SOURCE12
(
id
,Name
,country
 
)
values
(
:id
:,Name
:,country
);
.import infile /nas/infred/data/SrcFiles/fastload.txt
format vartext ','
display errors
nostop
layout InputFile_Layout
apply Table_InsertDML;
.end mload;
.logoff;
 
How i'm Calling:
$ ./multiload.sh
 
Output:

./multiload.sh: .LOGTABLE:  not found.
./multiload.sh[2]: .logon:  not found.
./multiload.sh[4]: .begin:  not found.
./multiload.sh[5]: .layout:  not found.
./multiload.sh[6]: 0403-057 Syntax error at line 6 : `(' is not expected.
 
 

dnoeth 4628 posts Joined 11/04
13 Mar 2016

That's a shell script, but not an MLoad script, the Unix shell complains about missing commands like ".LOGTABLE"
If you don't use shell features you run it using

mload < multiload.sh

 
If you want to run it standalone ("./multiload.sh") you must use Unix inline redirection:

mload << EOF

 all your existing code here

EOF

 

Dieter

13 Mar 2016

IT WORKED !!!
Thanx  a lot  Dieter i tried with the second option given by you .
(mload<multiload.sh ) what this thing exactly means?

dnoeth 4628 posts Joined 11/04
13 Mar 2016

That's the standard way to pass a script to a command line utility in Unix/Linux/Windows.
https://en.wikipedia.org/wiki/Redirection_(computing)

Dieter

13 Mar 2016

Thanx Dieter :)

You must sign in to leave a comment.