We help IT Professionals succeed at work.
Get Started

What is the SQL statement to change a computed column?

emocke
emocke asked
on
526 Views
Last Modified: 2013-12-09
Question:
Is there a way to change computed columns in Firebird 1.5 using a SQL statement?

Example:
For the sake of argument i'll use a simple example, lets say there is a table with the following DDL.

VAL1 int
VAL2 double precision
VAL3 computed by (select SOMEOTHERVAL from SOMEOTHERTABLE)
TOTAL computed by (VAL1*VAL2)

After deployment I realize my mistake, TOTAL should be VAL1*VAL3, to make matters worse VAL3 is dependent on a value in another table.

What I would usually to is to DROP the TOTAL column and ADD it again with the new DDL, this time I can't because of the dependancy in SOMEOTHERTABLE.

Yes, I know, I also have to drop the SOMEOTHERVALUE first and start to ADD again from there, but I would like to know if there is an easier way.


Comment
Watch Question
Principal Operations Engineer
CERTIFIED EXPERT
Commented:
This problem has been solved!
Unlock 1 Answer and 2 Comments.
See Answer
Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

  • Troubleshooting
  • Research
  • Professional Opinions
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE