By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
440,291 Members | 3,096 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 440,291 IT Pros & Developers. It's quick & easy.

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

P: n/a
Hi,

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.

Thanks.
GS-

Sep 5 '06 #1
Share this Question
Share on Google+
1 Reply


P: n/a
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.