troubleshooting Question

What is the SQL statement to change a computed column?

Avatar of emocke
emocke asked on
2 Comments1 Solution531 ViewsLast Modified:
Is there a way to change computed columns in Firebird 1.5 using a SQL statement?

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.

Nick Upson
Principal Operations Engineer

Our community of experts have been thoroughly vetted for their expertise and industry experience.

Join our community to see this answer!
Unlock 1 Answer and 2 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 2 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros