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: PRO*C question

Re: PRO*C question

From: Thomas Kyte <tkyte_at_us.oracle.com>
Date: Mon, 15 Jun 1998 20:29:58 GMT
Message-ID: <35858415.7330680@192.86.155.100>


A copy of this was sent to "LECONTE Denis" <leconte.d_at_decade.fr> (if that email address didn't require changing) On Mon, 15 Jun 1998 19:38:38 +0200, you wrote:

>Hi all !
>
>I am trying to optimize a PRO*C program on HP/UX and I am just
>wondering how FOR-LOOPs are expanded.
>
>For example, if I write:
>EXEC SQL FOR :MyCounter
> DELETE FROM MyTable
> WHERE MyPK = :MyArrayOfPKs;
>
>Does it expand to something like this (which is better):
>DELETE FROM MyTable
>WHERE MyPK IN (MyArrayOfPKs(1), ..., MyArrayOfPKs(MyCounter));
>
>or to something like that:
>FOR i IN 1..MyCounter LOOP
> DELETE FROM MyTable
> WHERE MyPK = MyArrayOfPKs (i);
>END LOOP;
>

This is the array interface. It will ship over :MyCounter inputs to the server and exeucte the delete statement :MyCounter times with :MyCounter different inputs.

The for loop is expanded on the server, not on the client...

>?
>
>Any help would be very appreciated. Many thanks.
>
>Of course I also use UPDATE statements but I think the answer will
>be the same.
>
>Denis.
>
 

Thomas Kyte
tkyte_at_us.oracle.com
Oracle Government
Herndon VA  

http://govt.us.oracle.com/ -- downloadable utilities  



Opinions are mine and do not necessarily reflect those of Oracle Corporation  

Anti-Anti Spam Msg: if you want an answer emailed to you, you have to make it easy to get email to you. Any bounced email will be treated the same way i treat SPAM-- I delete it. Received on Mon Jun 15 1998 - 15:29:58 CDT

Original text of this message

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