Lia Nungaray
asked on
Create Temporary table from Select statement
What would be the equivalent in Oracle for this MSSQL statement:
SELECT data1 INTO newtable FROM table1.
I haven't worked with MSSQL in a while, in this also correct?
SELECT column1 FROM table1 INTO #t1?
Thank you.
SELECT data1 INTO newtable FROM table1.
I haven't worked with MSSQL in a while, in this also correct?
SELECT column1 FROM table1 INTO #t1?
Thank you.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
"What would be the equivalent in Oracle for this MSSQL statement:
SELECT data1 INTO newtable FROM table1."
In Oracle, you can likely drop the "INTO newtable" part of that statement. Oracle supports simply selecting what you want from the table(s) you want, regardless of insert, update or delete activity that may be happening in the table(s). Oracle will give you a "read consistent" result set from the instant in time that your query was submitted. You will only see data that was already committed at that point in time.
As others indicated, Oracle supports "global temporary tables". In some (rare) cases, these can be helpful, but they aren't created (nor dropped) "on-the-fly" like temporary tables in SQL Server.
SELECT data1 INTO newtable FROM table1."
In Oracle, you can likely drop the "INTO newtable" part of that statement. Oracle supports simply selecting what you want from the table(s) you want, regardless of insert, update or delete activity that may be happening in the table(s). Oracle will give you a "read consistent" result set from the instant in time that your query was submitted. You will only see data that was already committed at that point in time.
As others indicated, Oracle supports "global temporary tables". In some (rare) cases, these can be helpful, but they aren't created (nor dropped) "on-the-fly" like temporary tables in SQL Server.
ASKER