troubleshooting Question

Oracle Vs. SQL Server Computed / Virtual Columns

Avatar of DB-aha
DB-aha asked on
Oracle DatabaseMicrosoft SQL Server
4 Comments4 Solutions1390 ViewsLast Modified:
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.
ASKER CERTIFIED SOLUTION
Join our community to see this answer!
Unlock 4 Answers and 4 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 4 Answers and 4 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros