Archives of the TeradataForum
Message Posted: Wed, 17 Jul 2002 @ 16:48:50 GMT
If the "-" is in different locations thru-out the data, you might try the following:
upd custtable set custfield = Substring (custfield from 1 for index(custfield,'-')-1) || '_' || substring (custfield from index(custfield,'-')+1 ) ;
This is the simple SQL approach. However, you must run this once per '-' that occurs in the data. In other words, for acct-chg-it, you must run this twice and it changes one '-' to '_' per run.
Now, this can be done in one run, but the second substring must be a substring starting from the index value that points after the second '-'. I did not have time to sit down and test the more elaborate approach. If you wish to contact me directly, so that I know who you are, we can discuss the more elaborate approach.
|Copyright 2016 - All Rights Reserved|
|Last Modified: 27 Dec 2016|