| Oracle FAQ | Your Portal to the Oracle Knowledge Grid | |
Home -> Community -> Usenet -> c.d.o.server -> Re: Computed column?
You can try to do it in several ways:
First possible solution:
Create the table 'Test' with column A integer, column B integer.
CREATE OR REPLACE VIEW v_test
AS
SELECT A, B, (A+B)/10 AS C
FROM Test;
Second solution:
Create table Test with column A integer, column B integer, column C number (n, m)
Create a trigger which will insert/update in C the computed value (A+B)/10.
Third solution: (works only if your table is a one-time thing):
Create table Test1 with column A integer, column B integer
CREATE TABLE Test
AS
SELECT A, B, (A+B)/10 AS C
FROM Test1
UNRECOVERABLE;
DROP TABLE Test1;
Hope this helps.
Michael Serbanescu
![]() |
![]() |