The Oracle replace function uses

Source: Internet
Author: User

The requirement is to modify a list of Oracle to replace all 100 of this column with 200;

Update B_nodes a set A.childs=replace ((select childs from B_nodes b where B.nodeid=a.nodeid), ' [+] ', ' $ ') where A.CHILDS&G t;10005

The following is reproduced http://www.cnblogs.com/BetterWF/archive/2011/12/21/2295937.html Thank you

The Replace function uses the following:

Replace (' string to be changed ', ' replaced string ', ' replace string ')

Example: Select replace (' 111222333444 ', ' 222 ', ' 888 ') from dual;

Output is ' 111888333444 '

When importing data into Oracle Today, there is a column to import the data should be in the format of ' 2011-10-11 ', the result of importing data is ' 2011/10/11 ' format, more than 5,000 records to change the basic impossible. Later thought of replace this function, the specific usage is as follows:

Update Table 1 T set t. Column 1=replace ((select column 1from table 1 A where a. primary key column =t. Primary key column), '/', '-') solves our problem.

The Oracle replace function uses

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.