How to remove carriage return and line break spaces in oracle

Source: Internet
Author: User

Remove line breaks
Update zhzl_address t set t. add_administration_num = replace (t. add_administration_num, chr (10 ),'');
Remove carriage return
Update zhzl_address t set t. add_administration_num = replace (t. add_administration_num, chr (13 ),'');
Remove Spaces
Update zhzl_address t set t. add_administration_num = trim (t. add_administration_num );
-----------------------------
1. Enter the line break
Chr (10) is a line break,
Chr (13) is the carriage return,
Add line breaks
Select 'update' | table_name |
'Set VALID_STATE = ''0a'; '| chr (13) | 'commit ;'
From user_tables
 
Delete line breaks
Select id, replace (content, to_char (chr (13) | to_char (chr (10), '_ r_n') from fact_content order by content;

Remove line breaks, carriage returns, and Tab summary from the text in oracle
I. ascii definition of special characters
Tab chr (9)
Linefeed chr (10)
Carriage Return chr (13)
2. Use repalce for nesting. Note that only one symbol can be submitted at a time. For example, press enter first and then line feed.
Select REPLACE (gg, chr (10), '') from dual
Note that chr (13) | chr (10) is used in many cases. It is better to use carriage return and line feed in notepad. Therefore, consider this situation.
Select translate (string, chr (13) | chr (10), ',') from dual;

3. symbol processing for Large Character objects
For the symbol processing in the clob field, to_char is first followed by the same processing
SQL> select to_char (vcl), replace (to_char (vcl), chr (10), '[]') from test_1;

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.