Home » RDBMS Server » Server Administration » Oracle equivalence for SqlServer #temp_table?
Oracle equivalence for SqlServer #temp_table? [message #370412] Wed, 22 September 1999 12:16 Go to next message
paulg
Messages: 2
Registered: September 1999
Junior Member
In SqlServer Stored Procedures you can specify a temporary table that is unique to the current connection.
Select emp_dept_key into #temp_emp from Employee where emp_hire_date > '1/1/1999'
select dept_name from department, #temp_emp
where dept_key = emp_dept_key

Is a trivial example. How can this be done in Oracle?
Thanks, Paul
Re: Oracle equivalence for SqlServer #temp_table? [message #370417 is a reply to message #370412] Wed, 22 September 1999 15:11 Go to previous messageGo to next message
m a sivan
Messages: 34
Registered: July 1999
Member
U can do a join
select dept_name from dept
where dept_key in ( select emp_dept_key from employee where hire_date > '1/1/99'

there are many ways to achieve this and this is just one way
Re: Oracle equivalence for SqlServer #temp_table? [message #370420 is a reply to message #370412] Wed, 22 September 1999 15:50 Go to previous messageGo to next message
MikeG
Messages: 14
Registered: August 1999
Junior Member
Oracle does not have the same temp table facility as Sybase but having written procs in both DB's i prefer Oracle. Oracle has more functions available (such as a decode) and better cursor handling functions.

Oracle does have 'tables' that are like arrays but you cannot run SQL against them.

If you still need a way around it submit the example and maybe we can suggest an Oracle equivalent.
Re: Oracle equivalence for SqlServer #temp_table? [message #370422 is a reply to message #370412] Wed, 22 September 1999 17:03 Go to previous message
paulg
Messages: 2
Registered: September 1999
Junior Member
Thanks for trying. Yes I know Oracle is Industrial strength and more capable than SQlServer, yes I know this example could be joined. My question still remains is there a way to create a table that is unique to the connection for temp storage. It's offen much better performance for one thing to stage queryies but in any case is there a solution for this or what is the best work around?
Thanks, Paul
Previous Topic: Copying LONG datatype from one table to another
Next Topic: ANY WAY FOR TRACKING ANONYMOUS BLOCK
Goto Forum:
  


Current Time: Wed Oct 21 11:55:54 CDT 2020