Results 1 to 3 of 3
  1. #1
    Join Date
    Jan 2004
    Posts
    153

    Unanswered: Updating partial column value

    Hi All,

    I have a table named 'country' with a varchar2 type column name 'country_status'.

    This column has value like below :

    ‘This is a developed country’
    ‘This is not a developed country’

    I would like to update the part of the column value ‘developed’ as ‘developing’ as below:

    ‘This is a developing country’
    ‘This is not a developing country’

    My query : Is there any way to achievethis using a single query without using the pl/sql block?


    Thanks with Regards,
    JD

  2. #2
    Join Date
    Nov 2003
    Posts
    2,932
    Provided Answers: 12
    Code:
    update country
       set country_status = replace(country_status, 'developed', 'developing')
    More details in the manual: http://docs.oracle.com/cd/E11882_01/...153.htm#i78608

    You should have stored the description of the status in a separate table together with a code and then reference that code from the country table.

    What happens if you need to translate that description sometime?

  3. #3
    Join Date
    Jan 2004
    Posts
    153
    Thanks Shammat for the solution and valuable suggestion.

    Regards,
    JD

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •