Ask the Expert

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;

    Requires Free Membership to View

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

There are Comments. Add yours.

 
TIP: Want to include a code block in your comment? Use <pre> or <code> tags around the desired text. Ex: <code>insert code</code>

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
Sort by: OldestNewest

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: