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

Home -> Community -> Usenet -> c.d.o.server -> Re: Oracle 9i features?

Re: Oracle 9i features?

From: Daniel Morgan <damorgan_at_x.washington.edu>
Date: Sat, 07 Feb 2004 17:20:58 -0800
Message-ID: <1076203210.477243@yasure>


Serge Rielau wrote:

> Sybrand Bakker wrote:
>

>> On 7 Feb 2004 00:39:22 -0800, pascaldamian_at_icqmail.com (Pascal Damian)
>> wrote:
>>
>>> * computed field/column is not supported, use VIEW for that purpose;
>>
>>
>>
>> Has been supported all the time
>>

> Sybrand,
> can you elaborate? When I researched generated columns I did
> not see that concept in the Oracle docs. Also I don't recall Oracle
> standards folks bringing it up when IBM brought the feature into SQL 4.
>
> What Pascal seems to be refering to is:
> SQL Server 2000: CREATE TABLE ... (c1 INT, c2 AS c1 + 5); (a virutal
> column)
> DB2 V7: ...c1 INT, c2 GENERATED ALWAYS AS (c1 + 5)..) (a materialized,
> functionally dependend, column)
>
> AFAIK you would either use index on expression or a combination of
> before trigger and check constraint in Oracle, depending on the intended
> use.
>
> Cheers
> Serge

CREATE TABLE test (
somecol NUMBER(5),
morecol NUMBER(5));

INSERT INTO test VALUES (1, 1);
COMMIT; CREATE OR REPLACE VIEW test_view AS
SELECT somecol, morecol, (somecol + morecol) product_col FROM test;

SELECT * FROM test_view;

This ability has been in Oracle for more than a decade.

-- 
Daniel Morgan
http://www.outreach.washington.edu/ext/certificates/oad/oad_crs.asp
http://www.outreach.washington.edu/ext/certificates/aoa/aoa_crs.asp
damorgan_at_x.washington.edu
(replace 'x' with a 'u' to reply)
Received on Sat Feb 07 2004 - 19:20:58 CST

Original text of this message

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