Archives of the TeradataForum
Message Posted: Fri, 26 Feb 2010 @ 14:03:39 GMT
Subj: | | Re: How to pass database name as parameter |
|
From: | | Mohommod.Khan |
Anomy
One way you can do this is dynamically create the top part of the script. If you can take the few parameters and combine with your mload
script and then run it, I think that will do the work.
On top of the script, you may do some thing like this:
-------------------------------------------------------------------
.SET DATABASENAME TO 'my DB';
.SET TARGETTABLE TO 'my Table ';
.SET IMPORTTABLE TO '&DATABASENAME..&TARGETTABLE';
.SET WORKTABLE TO '&DATABASENAME..WT_&TARGETTABLE';
.SET ERRORTABLE TO '&DATABASENAME..ET_&TARGETTABLE';
.SET UVTABLE TO '&DATABASENAME..UV_&TARGETTABLE';
-------------------------------------------------------------------
/*** on your Mload script you can now accept the above variables: *******/
DROP TABLE &ERRORTABLE;
DROP TABLE &UVTABLE;
DROP TABLE &WORKTABLE;
.BEGIN IMPORT MLOAD
TABLES
&IMPORTTABLE
WORKTABLES
&WORKTABLE
ERRORTABLES
&ERRORTABLE
&UVTABLE
-------------------------------------------------------------------
In UNIX/DOS you can just 'cat'/'echo' the two and create your script. Hope this helps.
Thanks
|