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

Home -> Community -> Usenet -> c.d.o.server -> Re: What syntax better (faster,cool)!

Re: What syntax better (faster,cool)!

From: Siphiwe Memela <siphiwe_at_cm.co.za>
Date: Tue, 08 Dec 1998 08:50:39 +0200
Message-ID: <366CCC3F.100CE51C@cm.co.za>


sokol_at_opsb.ru wrote:
>
> select COL into VAR from TABLE;
>
> or
>
> open CURSOR;
> fetch COL into VAR;
> close CURSOR;

Select...INTO... does two fetches on the database the other one to test for the exception TOO_MANY_ROWS. Open CURSOR, etc goes into the database once. The difference is in the cost of doing two database reads vs 3 operations(ie open, fetch, close). Personally, I think Open Cursor is better(esp. if the select is on a big table).

--

Siphiwe Muziwenkosi Memela              <siphiwe_at_cm.co.za>
Computer Management (Pty) Ltd.        Durban, South Africa
+--------------------------------------------------------+
|****** Imagination is intelligence taking a walk *******|
+--------------------------------------------------------+
Received on Tue Dec 08 1998 - 00:50:39 CST

Original text of this message

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