Home » SQL & PL/SQL » SQL & PL/SQL » what is the difference between "generated always as" and "as" at the time of creating virtual column (oracle 11g)
what is the difference between "generated always as" and "as" at the time of creating virtual column [message #637506] Tue, 19 May 2015 05:01 Go to next message
jgjeetu
Messages: 373
Registered: July 2013
Location: www.Orafaq.com/Forum
Senior Member

create table temp
(n1 number,
n2 number)


what is difference between these two statements
that we use to create virtual column in oracle 11g
because i dint find any difference in output both are doing the same work.

statement 1:-
ALTER TABLE temp ADD
(n3 GENERATED ALWAYS AS (n1 * n2))


statement 2:-
ALTER TABLE temp ADD
(n3 AS (n1 * n2))
Re: what is the difference between "generated always as" and "as" at the time of creating virtual column [message #637508 is a reply to message #637506] Tue, 19 May 2015 05:20 Go to previous messageGo to next message
vippysharma
Messages: 73
Registered: May 2013
Location: www
Member
I think no such difference is there.
http://oracle-base.com/articles/11g/virtual-columns-11gr1.php
Re: what is the difference between "generated always as" and "as" at the time of creating virtual column [message #637509 is a reply to message #637506] Tue, 19 May 2015 05:32 Go to previous messageGo to next message
Michel Cadot
Messages: 68633
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator

Just have a look at the syntax of a virtual column in the documentation and you will see.

Re: what is the difference between "generated always as" and "as" at the time of creating virtual column [message #637511 is a reply to message #637506] Tue, 19 May 2015 06:17 Go to previous message
Lalit Kumar B
Messages: 3174
Registered: May 2013
Location: World Wide on the Web
Senior Member
From the documentation link that Michel provided:

Quote:
The keywords GENERATED ALWAYS are provided for syntactic clarity. They indicate that the column is not stored on disk, but is evaluated on demand.
Previous Topic: regexp_replace comma separated whole string
Next Topic: Dirty read issues
Goto Forum:
  


Current Time: Mon Apr 15 23:30:01 CDT 2024