Link to home
Start Free TrialLog in
Avatar of DB-aha
DB-aha

asked on

Oracle Vs. SQL Server Computed / Virtual Columns

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.
SOLUTION
Avatar of Scott Pletcher
Scott Pletcher
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial