Re: Request of an opinion about a procedure - (where current of)

From: DanHW <danhw_at_aol.com>
Date: 20 Aug 2000 00:38:49 GMT
Message-ID: <20000819203849.22594.00000464_at_ng-ba1.aol.com>


>Francesco Dini wrote:
>>
>> 6 CURSOR C1 IS
>> 7 SELECT *
>> 8 FROM LFBAGARR
>> 9 WHERE POSTAZIONE = I_POSTAZIONE
>> 10 FOR UPDATE;
>> 11 C1%ROWTYPE
>> .....
>>
>> 33 BEGIN
>> 34 OPEN C1;
>> 35 FETCH C1 into REC1;
>> 36 WHILE C1%FOUND LOOP
>>
>> ....
>>
>>
>> 179 DELETE LFBAGARR WHERE CURRENT OF C1;
>> 180 commit;
>> 181 close c1;
>> 182 open c1;
>> 183 END IF;
>> 184 FETCH C1 INTO REC1;
>> 185 END LOOP;
>> 186 CLOSE C1;
>> 187 END;
>>
>> For me it' is a bad procedure: for you ?
>>
>
>

especially since it can be done much more efficiently through a straight SQL statement; no need to write any PL/SQL looping/cursors etc...

delete FROM LFBAGARR
WHERE POSTAZIONE = I_POSTAZIONE;
commit;

Dan Hekimian-Williams Received on Sun Aug 20 2000 - 02:38:49 CEST

Original text of this message