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: PL-SQL table and Cursor

Re: PL-SQL table and Cursor

From: sybrandb <sybrandb_at_gmail.com>
Date: 7 Dec 2006 04:36:33 -0800
Message-ID: <1165494993.158287.246660@f1g2000cwa.googlegroups.com>

On Dec 7, 12:32 pm, "varsha.gade..._at_gmail.com" <varsha.gade..._at_gmail.com> wrote:
> I have lacks of records. I want to check if the account_no is present
> in that table or not. In my current application i have used cursor.
>
> If i took all the account no data in pl-sql table with index as account
> no and value as account no,
> and then i will just try to check if the record is present at
> particular index then, will it be the faster way than cursor? if yes
> how?

The general rule is: only do it in PL/SQL if you can't do it in SQL (which is obviously not true here, as you can. SELECT ... where not exists would work like a charm).
Only do it in some 3 GL language if you can't do it in PL/SQL. If you think it will be faster, consider you need to populate the PL/SQL table.
Run explain plan on the affected statement and find out what happens. Do not resort to procedural techniques.

-- 
Sybrand Bakker
Senior Oracle DBA
Received on Thu Dec 07 2006 - 06:36:33 CST

Original text of this message

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