Results 1 to 4 of 4

Thread: changing c to C

  1. #1
    Join Date
    Mar 2004
    Posts
    11

    Unanswered: changing c to C

    I recently placed several hundred rows records into a database with primary keys that have a c in front of them. I just found out that they needed to have a capital C in front of them. They currently look like this

    c545936
    c545937
    c545938
    etc......

    I need to change them to

    C545936
    C545937
    C545938
    etc......

    I was wondering if there is a quick way to change out the c on the front of the number to a capital C. There are other records in the database that have A and B in front of them so I would only want to change the C. Any ideas, code would be appreciated

  2. #2
    Join Date
    Aug 2003
    Location
    Where the Surf Meets the Turf @Del Mar, CA
    Posts
    7,776
    Provided Answers: 1
    TRANSLATE, REPLACE, or SUBSTR could be used.
    You can lead some folks to knowledge, but you can not make them think.
    The average person thinks he's above average!
    For most folks, they don't know, what they don't know.
    Good judgement comes from experience. Experience comes from bad judgement.

  3. #3
    Join Date
    Mar 2004
    Posts
    11
    If I were to use replace how would I do it?

  4. #4
    Join Date
    Jan 2004
    Location
    India
    Posts
    191
    Hi,

    Method 1:

    Update Table_name
    set Column_name=Replace(Column_name,'c','C')

    Method 2:

    If table is huge, u can do like

    1. Create same table with another name
    Create table table_name1 as
    Select upper(column_name) as Column_name, other_columns
    from table_name
    2. Drop original table .e. table_name
    3. Rename table_name1 to table_name
    4.Create all constraint

    Hope above method will work

    Thanks,
    Pagnint
    (No need to search web before posting new question)

Posting Permissions

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