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: Slight "I have some string, how lng it it, BTW, it's blue" question

Re: Slight "I have some string, how lng it it, BTW, it's blue" question

From: Malcolm Dew-Jones <yf110_at_vtn1.victoria.tc.ca>
Date: 7 Jun 2006 09:34:09 -0800
Message-ID: <44870001@news.victoria.tc.ca>


Andrew (andrewgothard_at_Nospamthanks.com) wrote:

: Sorry it this isn't clear - the reasoning behind some of the use of cursors
: to mimic joins is way beyond me. but I'd always been given to believe that
: use of cursors was a total last resort, not a good standard approach.

I assume you mean code like

	loop over cursor1 rows
	  open cursor2(lookup_id_from_cursor1)
	  loop over cursor2 rows
		-- in here we have the "joined" data from 1 and 2
	  end loop 2
	  close cursor2
	end loop 1

A real join within an single sql statement would normally be much better than using plsql and cursors to access multiple tables and "join"ing them yourself.

If you have to do a join over a database link then it maybe better to mimic the join yourself with something like the above, but I wouldn't assume that, it's just a thing to keep in mind. I would guess that each newer version of Oracle is probably reducing the number of occasions where that would be true.

(i.e.)	select * 
	from table1 t1 , table2_at_dblink t2
	where t1.id=t2.id
Received on Wed Jun 07 2006 - 12:34:09 CDT

Original text of this message

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