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.
Oracle DatabaseMicrosoft SQL Server

Avatar of undefined
Last Comment
Scott Pletcher

8/22/2022 - Mon
SOLUTION
Scott Pletcher

Log in or sign up to see answer
Become an EE member today7-DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform
Sign up - Free for 7 days
or
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
Not exactly the question you had in mind?
Sign up for an EE membership and get your own personalized solution. With an EE membership, you can ask unlimited troubleshooting, research, or opinion questions.
ask a question
SOLUTION
slightwv (䄆 Netminder)

Log in or sign up to see answer
Become an EE member today7-DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform
Sign up - Free for 7 days
or
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
Not exactly the question you had in mind?
Sign up for an EE membership and get your own personalized solution. With an EE membership, you can ask unlimited troubleshooting, research, or opinion questions.
ask a question
SOLUTION
Log in to continue reading
Log In
Sign up - Free for 7 days
Get an unlimited membership to EE for less than $4 a week.
Unlimited question asking, solutions, articles and more.
ASKER CERTIFIED SOLUTION
Log in to continue reading
Log In
Sign up - Free for 7 days
Get an unlimited membership to EE for less than $4 a week.
Unlimited question asking, solutions, articles and more.
Experts Exchange is like having an extremely knowledgeable team sitting and waiting for your call. Couldn't do my job half as well as I do without it!
James Murphy