Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 4549638
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T16:23:17+00:00 2026-05-21T16:23:17+00:00

I would like to have a column in my DB accessible via two column

  • 0

I would like to have a column in my DB accessible via two column names temporarily.

Why? The column name was badly chosen, I would like to refactor it. As I want my webapp to remain stable while changing the column name, it would be good to

  1. have a (let’s call it) symlink named better_column_name pointing to the column bad_column_name
  2. change the webapplication to use better_column_name
  3. drop the symlink and rename column to better_column_name

“Refactoring Databases” suggests to actually add a second column which is synchronized on commit in order to achieve this. I am just hoping that there might be an easier way with Oracle, with less work and less overhead.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-21T16:23:17+00:00Added an answer on May 21, 2026 at 4:23 pm

    As long as you have code that uses both column names, I don’t see a way to get around the fact that you’ll have two (real) columns in that table.

    I would add the new column with the correct name and then create a trigger that checks which column has been modified and updates the “other” column correspondingly. So whatever is being updated, the value is synch’ed with the other column.

    Once all the code that uses the old column has been migrated, remove the trigger and drop the old column.

    Edit

    The trigger would so do something like this:

    CREATE OR REPLACE TRIGGER ...
        ...
        UPDATE OF bad_column_name, better_column_name ON the_table 
        ...
    BEGIN
      IF UPDATING ('BAD_COLUMN_NAME') THEN 
         :new.better_column_name = :new.bad_column_name
      END IF;
    
      IF UPDATING ('BETTER_COLUMN_NAME') THEN 
         :new.bad_column_name = :new.better_column_name
      END IF;
    END;
    

    The order of the IF statements controls which change has a “higher priority” in case someone updated both columns at the same time.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I would like to have a two column layout of posts. It should be
I would like to have one column in QTableWidget NOT editable. In forums I
I have the column DateTimeExpired, and I would like to create another column called
I have a dataframe with a column of integers that I would like to
I have a dataframe and would like to add a new column where the
I have a dataframe with one column that I would like to split into
I have a column with values like A001, B002 AND 003, 004. I would
I would like to have a column in an org mode table that is
I have column with the type ntext , and I would like to convert
I would like to have a primary key column in a table that is

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.