Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: Modify Table Insert Calculated Column
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 DBAReceived on Fri Apr 21 2006 - 14:04:39 CDT
![]() |
![]() |