Attach cursor or record installed in oracle

I have good experience in sea bass and I began to look at the oracle in my free time. Most sybase procedures I've worked with have temporary tables, and it makes sense to combine two or more temp tables to get a set of results.

Question: Is there a way to combine two or more cursors, such as a logical table.

Sort of:

SELECT c1.id, c2.name FROM cursorEmp c1, CursorDept c2 WHERE c1.DeptId = c2.DeptId 
+4
source share
2 answers

You cannot join two cursors, no.

You could, of course, combine the two basic queries, i.e.

 SELECT c1.id, c2.name FROM (SELECT * FROM emp WHERE ename = 'KING') c1, (SELECT * FROM dept WHERE dname = 'ACCOUNTING') c2 WHERE c1.DeptID = c2.DeptID 

In Oracle, since readers do not block authors (and vice versa), it is very rare to use temporary tables. Usually you simply query the base tables using views, depending on how you provide the appropriate levels of abstraction.

+8
source

Oracle has its own version of temporary tables (persistent structures with temporary data stored during both the transaction and the session) - you could think about using them, although (as Justin suggested) you could also combine the two main queries.

0
source

All Articles