Hi Raul,
yes, should be possible.
Could you post some more details, file layout, example records etc.
Dieter
Hi Raul,
ACCEPT and IF/ELSE are the wrong places, you have to redefine the input layout and use different APPLYs, e.g.
.layout test;
.field c1 * integer;
.field c2d * decimal(4,1);
.field c2v 3 varchar(4); -- redefine the input position
.field c3 * varchar(2);
.dml label l1;
sql for c3='b'
.dml label l1;
sql for c3='t'
.IMPORT ...
FORMAT ???
LAYOUT test
APPLY l1 WHERE c3 = 'b'
APPLY l2 WHERE c3 = 't';
Regading the input records, what's the FORMAT: BINARY\TEXT\VARTEXT?
Is it readable information or binary data?
Dieter
Hi Raul,
if the input format is readable text or vartext, then you don't specify DECIMAL within the FIELD, it's CHAR or VARCHAR. The cast will be done automatically or by using CAST(col as DEC(..)) within the Insert.
ACCEPT reads a *single* row from input, but you want to load a file with lots of rows in different formats.
Check the manuals for "redefining the layout".
You talked about your prof, so out of curiosity:
Which university offers Teradata classes?
Dieter
Hi Forum Masters,
I was facing the same problem as described in this post...
I am not getting how this repositioning really works...
Suppose my input records are
12|2.3|b
10|c|t
layout is
.layout test;
.field c1 * integer;
.field c2d * decimal(4,1);
.field c2v 3 varchar(4); -- redefine the input position
.field c3 * varchar(2);
client will read 12 store it in field c1...next is 2.3 stored in c2d after that it will reposition and again come to 3rd position that is 2of decimal 2.3 or directly go to c....basically not able to get what will happen to 'b'
Please throw some insight how exactly it is going on.......
Your help will make all of us better understand this redefining the input concept Gurus
Would be appreciable if you throw some light please..............
Prakhar,
Layout reflects the source file format.
So in the case above it will check data field by field, when it encounters decimal it will go with c2d skips c2v and goes on as you have correctly mentioned.
For the 2nd scenario of c3='t', it will encounter varchar which is not of data type decimal as in layout, so the pointer is lost as it does not matches with the field type, but as we specified position 3, so it will start reading from that field onwards and take the field as varchar.
Hope it helps...
Ankit
Thankx Ankit

hi this is raul
is it possible in mload to use different layout for same infile,
i mean i am receving data in which one occurence of column is of datatype integer and the other occurence of data is of datatype varchar -- i hope i made it clear
kindly can u reply fast, it will solve one of the major problem hindering me to go ahead in my university project