passing parameters to mload
Teradata Teradata Discussion Forums Teradata.com Discussion Forum
Visit Teradata.com
Home       Guidelines    Member List
Welcome Guest ( Login | Register )
        


This online forum is for user-to-user discussions of Teradata products, and is not an official customer support channel for Teradata. If you require direct assistance, please contact Teradata support.


passing parameters to mload Expand / Collapse
Author
Message
Posted 11/5/2009 3:38:17 PM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: Forum Members
Last Login: 11/13/2009 1:21:00 PM
Posts: 2, Visits: 16
Hi guys,

I donot know the syntax for passing parameter to mload.

I am trying to pass two strings as parameter to mload script file and use these string parameters in the script.

something like mload [TableName, SOURCEFILENAME] <Path of sourcefilename.

Here is my scenario:

This is the part of mload script where i want to use the passed string(in INSERT STAMENT below). In TestTable(Teradata table) , there is a column called stream which contains the source file name from which data is loaded into TestTable in Teradata.

In this case the source file name is 'Caliente' which is entered manually in the insert statement below.

There are many source files like these from which i need to extract data from and put the corresponding source file name in Stream column. So as first step i would like to pass the source file name as parameter to mload while calling the file that contains the script.

INSERT INTO "TestTable " ( Dance_ID, Delete_Flag, Cat_ID, Non_Music,
Mark_Status, Run_Time, Daypart, Add_Date,
Add_Date_DATE, Add_Date_TIME, Del_Date,
Del_Date_DATE, Del_Date_TIME, Cat_Plays,
Lib_Plays, Old_Skips, Old_Fails,
Perf_Count, Rot_Weight, Max_Daily,
Old_Start, Old_Kill, Kill_Plays,
Simulcast, Tag_Along, Packet_ID,
Audio_Ptr, Master_Ptr, Edit_Date,
Edit_Date_DATE, Edit_Date_TIME, Move_Date,
Move_Date_DATE, Move_Date_TIME, Move_Cat,
Start_Hour, Start_Hour_DATE,
Start_Hour_TIME, Kill_Hour,
Kill_Hour_DATE, Kill_Hour_TIME, Stream )
VALUES ( :Dance_ID, :Delete_Flag, :Cat_ID, :Non_Music, :Mark_Status,
:Run_Time, :Daypart, :Add_Date, :Add_Date_DATE,
:Add_Date_TIME, :Del_Date, :Del_Date_DATE, :Del_Date_TIME,
:Cat_Plays, :Lib_Plays, :Old_Skips, :Old_Fails, :Perf_Count,
:Rot_Weight, :Max_Daily, :Old_Start, :Old_Kill, :Kill_Plays,
:Simulcast, :Tag_Along, :Packet_ID, :Audio_Ptr, :Master_Ptr,
:Edit_Date, :Edit_Date_DATE, :Edit_Date_TIME, :Move_Date,
:Move_Date_DATE, :Move_Date_TIME, :Move_Cat, :Start_Hour,
:Start_Hour_DATE, :Start_Hour_TIME, :Kill_Hour,
:Kill_Hour_DATE, :Kill_Hour_TIME, 'Caliente' ) ;

The other string parameter should be used to specify the source file name in import infile statement. In this case:(see the code below)
instead of C:\TD_ETL\ACEESS_ FILES_TEST\TestTable _Caliente.amj i should have C:\TD_ETL\ACEESS_ FILES_TEST\SOURCEFILENAME.amj where SOURCEFILENAME is other parameter passed in the mload.


.IMPORT INFILE "C:\TD_ETL\ACEESS_ FILES_TEST\TestTable_Caliente.amj"
AXSMOD Oledb_Axsmod 'noprompt'
LAYOUT Layout1
APPLY LabelA ;


Thanks in advance..


Regards,
BYP.
Post #17259
Posted 11/5/2009 3:45:37 PM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: Forum Members
Last Login: 11/13/2009 11:25:18 AM
Posts: 1, Visits: 10
If possible try scripting this and use the script do it. I'm not really sure if you can pass parameters to mload.
Post #17260
Posted 11/6/2009 10:58:30 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: Forum Members
Last Login: 11/13/2009 1:21:00 PM
Posts: 2, Visits: 16
Thanks for the reply..

I am trying to write windows script(not allowed to use shell scripts) to identify total number of source files and run a loop for this number.

I will use something like xxxxx in place of source file name and yyyy in place of the source file name path.

Every time this loop runs, it looks for the mload script file and replaces xxx with the source file name and yyy with source file name path. It then executes the mload script for each loop run.

I am not familiar with the scripting though. i should look for proper syntax to find the number of files in a directory, searching a file, replacing any character in specified file etc. Any suggestions will be appreciated..



Regards,
BYP.
Post #17272
« Prev Topic | Next Topic »


Reading This Topic Expand / Collapse
Active Users: 0 ( 0 guests, 0 members, 0 anonymous members )
No members currently viewing this topic.


All times are GMT -5:00, Time now is 8:35am

Powered By InstantForum.NET v4.1.4 © 2009
Execution: 0.141. 8 queries. Compression Disabled.