Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> Re: Why Oracle don't have AUTO_INCREMENT as in MySQL
hasta_l3_at_hotmail.com wrote:
> On 22 avr, 20:07, DA Morgan <damor..._at_psoug.org> wrote: >> hasta..._at_hotmail.com wrote:
>> I can understand the allure of such but laziness being >> what it is I would expect most developers to be lazy and >> the quality of applications to suffer. >> -- > > Quite to the contrary, Daniel. The less code you write, > the most solid an application is...
Based on that statement then I would assume that
BEGIN
FOR r IN (SELECT * FROM parent)
LOOP
is more efficient than:
DECLARE TYPE myarray IS TABLE OF parent%ROWTYPE; l_data myarray;
CURSOR r IS
SELECT part_num, part_name
FROM parent;
BEGIN
OPEN r;
LOOP
FETCH r BULK COLLECT INTO l_data LIMIT 1000;
FOR j IN 1 .. l_data.COUNT LOOP l_data(1).part_num := l_data(1).part_num * 1; END LOOP; FORALL i IN 1..l_data.COUNT INSERT INTO child VALUES l_data(i); EXIT WHEN r%NOTFOUND;
I can get you a couple of dozen other similar examples if you'd like.
The truth is that the less code you write the less is written. It has nothing whatsoever to do with the quality, performance, or scalability.
You might wish to reconsider.
-- Daniel A. Morgan University of Washington damorgan_at_x.washington.edu (replace x with u to respond) Puget Sound Oracle Users Group www.psoug.orgReceived on Mon Apr 23 2007 - 10:10:17 CDT