Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> Re: Generated by column syntax
On Aug 30, 4:11 pm, Brian Peasland <d..._at_nospam.peasland.net> wrote:
> This is a new 11g feature. Found at the following:
>
> http://download.oracle.com/docs/cd/B28359_01/server.111/b28286/statem...
Well, it's similar to an 11g new feature, but I don't see any GENERATED [ALWAYS] BY syntax:
SQL> CREATE TABLE testtab
2 ( dt DATE
3 , year INTEGER AS ( EXTRACT(YEAR FROM dt) ) );
Table created.
SQL> INSERT INTO testtab(dt) VALUES(sysdate);
1 row created.
SQL> SELECT * FROM testtab;
DT YEAR ----------- ---------- 03-SEP-2007 2007
1 row selected. Received on Wed Sep 05 2007 - 17:43:00 CDT
![]() |
![]() |