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 -> Replacing a subselect with Collections

Replacing a subselect with Collections

From: <fmarchioni_at_libero.it>
Date: 23 Feb 2005 01:26:47 -0800
Message-ID: <1109150807.368410.113200@z14g2000cwz.googlegroups.com>


Hi all oracle users,
I have a cursor which fetches a few thousand records. Inside it I have a subselect which is used for decoding one field.

CURSOR snap_crs IS
 SELECT decode (snap.id, 1,

(select code_ptr from anag_ptr where desc_ptr = snap.ptr_a),

(select code_ptr from anag_ptr where desc_ptr = snap.ptr_b)

           ),
        ..... other fields....


My question is: since * anag_ptr * is a static table (doesn't ever change),
is it worthy to replace the subselect with values taken from a Collection ?

Having a Java background I would use an Hashtable to insert couples (code_ptr,desc_ptr)...but what about pl/sql ? can I do the same ?

Thanks a lot
Francesco Received on Wed Feb 23 2005 - 03:26:47 CST

Original text of this message

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