Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Re: Modify Table Insert Calculated Column

Re: Modify Table Insert Calculated Column

From: Sybrand Bakker <postbus_at_sybrandb.demon.nl>
Date: Fri, 21 Apr 2006 21:04:39 +0200
Message-ID: <23bi421iea8emm7nrogsde5b0vcmoch9cn@4ax.com>


On 21 Apr 2006 10:02:06 -0700, biggs_at_trilliant.com wrote:

>Please tell me the syntax for inserting a calculated column into an
>Oracle 10g database. The SQL Server ALTER TABLE code won't work. A
>simple example:
>
>ALTER TABLE Rentals
> ADD TotalRentals AS TotalRentals + RentalQuantity;
>
>I've spent a couple hours searching the doc & Google and I'm coming up
>emty handed. This should be simple!
>
>Thanks

Calculated columns in a database have nothing to do with design, but are a denormalization. Denormalizations shouln't be simple. Either set up a view as Carlos suggested, or set up a trigger. How to do this, I will leave you as an exercise in doc reading.

--
Sybrand Bakker, Senior Oracle DBA
Received on Fri Apr 21 2006 - 14:04:39 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US