Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Re: Too Many Cursors?

Re: Too Many Cursors?

From: stephen O'D <stephen.odonnell_at_gmail.com>
Date: 4 Oct 2005 09:46:46 -0700
Message-ID: <1128444406.795844.272160@g14g2000cwa.googlegroups.com>


So i think what you are saying here is join b_table with a_table , but only join if there are no rows with a b_table.val4 greater than the current row. I am guessing you are attempting to find the newest version of a row or something. Would something like this work better:-

select a.val1,
       b.val2,
       b.val3
from a_table a,
		(select a_key, max(val4)
 		 from b_table
 	         group by a_key) new_b_table

where a.key = b.a_key
and a.val2 = parameter

The reason you are getting too many open cursors, is because you have opened a cursor for every row of the query results - there is a setting in the init.ora that limits the number of open cursors.

You will have work out a better way of writing the SQL for this problem, as opening a new cursor for each row is not going to work.

Try and post what you are trying to achive here, and someone will help you out. Received on Tue Oct 04 2005 - 11:46:46 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US