|
|
Archives of the TeradataForum
Message Posted: Fri, 20 Apr 2007 @ 11:09:22 GMT
Subj: | | SQL Functions in MLOAD Script.. |
|
From: | | Chakinala, Raju |
Hi,
As per my requirement , I have to load source file data into table(s) where perticular column should have the value ( i.e should not be null),
I am using where condition in APPLY phase ,but I could not successful , It seems to be it does not like TRIM function in APPLY phase and also I
tried by creating extra derived field (F_col4 * CHAR(10) TRIM(F_Col1) in layout section and used it where condition in APPLY phase , But in this
case also it did not go through
Any thoughts ..
Here is my control file.
.LOGTABLE TEMP_DB.Table1;
.run file LOGON_FILE;
.BEGIN IMPORT MLOAD
TABLES TARGET_DB.Table1,
TARGET_DB.Table2
WORKTABLES WK_DB.Table1,WK_DB.Table2
ERRORTABLES ERR_DB.ET_Table1,ERR_DB.ET_Table2
.LAYOUT File_Layout;
.FIELD F_Col1 1 CHAR(10);
.FIELD F_Col2 * CHAR(15);
.FIELD F_Col3 * CHAR(15);
.FIELD F_Col4 * CHAR(4);
.DML LABEL Insert1 ;
INSERT DEST_DB.TABLE_1
(:F_Col1,:F_Col2,:F_Col3)
.DML LABEL Insert2 ;
INSERT DEST_DB.TABLE_1
(:F_Col1,:F_Col2,:F_Col3,:F_Col4)
.IMPORT INFILE file.dat
Layout File_Layout
Format Text
Apply Insert1 where trim(F_col1) <> ''
Apply Insert2 where trim(F_Col1) <> ''
.END MLOAD;
.LOGOFF;
| |