on 04-13-2011 8:27 AM
Hello!
maybe someone has a hint for me how to remove special characters such as tab/new line characters from columns?
Thanks in advance!
Tiberius
Hi there,
how about [REPLACE|http://maxdb.sap.com/doc/7_7/44/d9eed6b7f74427e10000000a155369/frameset.htm] function?
regards,
Lars
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hmm... actually it's straight forward:
drop table mytexts
//
create table mytexts (comment varchar(50))
//
insert into mytexts values ('This is a standard text!')
//
insert into mytexts values ('There comes a TAB <--')
//
insert into mytexts values ('This is called a newline
<--<')
//
select * from mytexts
| COMMENT |
| -------------------------------------------------- |
| This is a standard text! |
| There comes a TAB <-- |
| This is called a newline
<--< |
3 rows selected (1375 usec)
//
sqlcli db770=> select replace (replace(comment, ' '), '
> ') as cleaned_comment from mytexts
> ;
| CLEANED_COMMENT |
| -------------------------------------------------- |
| Thisisastandardtext! |
| TherecomesaTAB<-- |
| Thisiscalledanewline<--< |
3 rows selected (1662 usec)
Seems to work...
regards,
Lars
User | Count |
---|---|
93 | |
10 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.