469,950 Members | 1,933 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,950 developers. It's quick & easy.

UDB V8.2 : Append value to a column while loading using Method L


I have a input file in the following format ,

1-4 5-8 9-10 11 12-14
1000 +500 25 1 250
2000 -520 55 1 25
2500 *525 55 1 125

I want to append position 5 and 11 and load into a column(ex. in the
previous case apppending position 5 and 11 we get "+1" and "-1" for the
two corresponding rows. Is this possible in UDB ?

If the above is possible, is it possible to append a value say "x" to
position 5, while loading. the result in this case would be "+x", "-x"
and "*x"

Note: The input file/pipe shouldn't be changed. In substance, I want to
generate the value based on two fileds that are not close together in
the input file. If that option is not available, I want to append a
known value/constant to the value in position say 5 and load the
resultant vale into the table.


Sep 5 '06 #1
1 1471
Search for "generated column udb db2" and see what you get.

Assuming you're loading 5-8 and 11 into columns anyway, you could
define your generated column as sign([5-8]) * [11]

Of course, you might then say you don't want the rest of 5-8 and 11 in
your target table. But I guess you can stick it into a staging table
and then insert the results of that into the final target table. (Or
use LOAD FROM CURSOR, which I guess could give better performance than
an INSERT...)

Hope that helps.

Sep 6 '06 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

6 posts views Thread by allyn44 | last post: by
3 posts views Thread by ethoemmes | last post: by
2 posts views Thread by Ray Holtz | last post: by
3 posts views Thread by =?ISO-8859-2?Q?Gregor_Kova=E8?= | last post: by
42 posts views Thread by Armin | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.