![]() |
|
Archives of the TeradataForumMessage Posted: Tue, 20 Feb 2001 @ 18:49:07 GMT
Hello everyone, I'm using multiload to upsert data. The input file I'm using is an ascii variable length text file. The first n fields are fixed length, and the length of the last field "floats" based on the value in the field. It seems like the only way I can define this type of file is as vartext, a single field as varchar, and then use substr to reference the individual fields in the insert statement. This works but is a little painful from a documentation standpoint. Have you ever had this problem, or do you know a better way of approaching this? Thanks, Russ
(...)
.layout lay1;
.FIELD entirerecord * varchar(36);
/* Actual file layout
CategoryId Char(3)
DepartmentId Char(3)
CategoryName Char(30) */
(...)
insert into category
values (
substr(:entirerecord,4,3)
,substr(:entirerecord,1,3)
,substr(:entirerecord,7,30)
);
(...)
format vartext
| ||||||||||||||||||||||||||||||||||||||||||||||||
| | ||||||||||||||||||||||||||||||||||||||||||||||||
| ||||||||||||||||||||||||||||||||||||||||||||||||
|
| ||||||||||||||||||||||||||||||||||||||||||||||||
| Copyright 2016 - All Rights Reserved | ||||||||||||||||||||||||||||||||||||||||||||||||
| Last Modified: 15 Jun 2023 | ||||||||||||||||||||||||||||||||||||||||||||||||