Q

Getting end of communication error when submitting a query

1) When I submit the query below, it takes time, and then I get an end of communication error. Can you tell me why it happens?

 
 select a.empno,b.empno from
 (select rownum arow, empno from emp) a
 full outer join 
 (select rownum brow, empno from emp) b
 on a.arow = b.brow;
2) And also for the below query, I am getting a cartesian product, and I want to know why it happens.
 
 select a.empno,b.empno from
 (select '1' arow, empno from emp) a
 full outer join 
 (select '1' brow, empno from emp) b
 on a.arow = b.brow;

1) The dreaded ORA-3113 errors are never easy to track down. This means that your network connection to the database is being severed. I'm assuming that you are able to duplicate the the problem no matter when you issue the above query. If this is the case, then there is something going on in your session which is terminating your database connection. You'll have to turn client tracing on in your SQLNET.ORA file and send the trace files to Oracle Support for review.

2) You are not getting a "cartesian product", but a full outer join. This is exactly what you asked for. But you specified that the 'arow' and 'brow' columns contains the exact same number, the number '1', for EVERY ROW in each subquery! So every row from 'a' matches every row from 'b'.

Since every row in each subquery matches, the result set of your full outer join will be no different than a cartesian product, which matches every row in 'a' to every row in 'b'. In essence, you have forced a cartesian product.

For More Information


This was first published in August 2002

Dig deeper on Oracle database design and architecture

Pro+

Features

Enjoy the benefits of Pro+ membership, learn more and join.

Have a question for an expert?

Please add a title for your question

Get answers from a TechTarget expert on whatever's puzzling you.

You will be able to add details on the next page.

0 comments

Oldest 

Forgot Password?

No problem! Submit your e-mail address below. We'll send you an email containing your password.

Your password has been sent to:

-ADS BY GOOGLE

SearchDataManagement

SearchBusinessAnalytics

SearchSAP

SearchSQLServer

TheServerSide

SearchDataCenter

SearchContentManagement

SearchFinancialApplications

Close