We help IT Professionals succeed at work.

Oracle Vs. SQL Server Computed / Virtual Columns

1,385 Views
Last Modified: 2014-05-14
I was trolling around reading various articles and ran into the following link:

http://devcorner.georgievi.net/pages/database/oracle_database/oracle_tips/virtual-columns-oracle

In short, it goes into introducing a virtual column in Oracle 11g. I did not realize that this feature would be a new feature as I had been using something similar in SQL Server for some time to either create a placeholder column with a default value that would later be used or contain a computed value as a solution to a calculation that generates a value to be stored in that named field.

The question I have is, Lets say in SQL Server I do:

SELECT
     TableID,
     0 AS MyCustomColumnName
FROM TableName

In both Oracle and SQL Server, are these known as virtual columns or do they have different names between the 2 platforms? What are the differences between doing t his in either platform if any?

The article mentions:

You should keep in mind that:

virtual columns may not reference other virtual columns;
virtual columns only within the containing table. You cannot reference columns within other tables.

So that does that mean in a package in oracle where multiple stored procedures are created and ran, that one computed column value cannot be referenced from another stored procedure? I am interested in hearing about both platforms but my preference at this point in time leans more to the oracle side.
Comment
Watch Question

Scott PletcherSenior DBA
CERTIFIED EXPERT
Most Valuable Expert 2018
Distinguished Expert 2019
Commented:
This one is on us!
(Get your first solution completely free - no credit card required)
UNLOCK SOLUTION
CERTIFIED EXPERT
Most Valuable Expert 2012
Distinguished Expert 2019
Commented:
This one is on us!
(Get your first solution completely free - no credit card required)
UNLOCK SOLUTION
CERTIFIED EXPERT
Most Valuable Expert 2012
Distinguished Expert 2019
Commented:
This one is on us!
(Get your first solution completely free - no credit card required)
UNLOCK SOLUTION
Senior DBA
CERTIFIED EXPERT
Most Valuable Expert 2018
Distinguished Expert 2019
Commented:
This one is on us!
(Get your first solution completely free - no credit card required)
UNLOCK SOLUTION
Unlock the solution to this question.
Join our community and discover your potential

Experts Exchange is the only place where you can interact directly with leading experts in the technology field. Become a member today and access the collective knowledge of thousands of technology experts.

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.