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's wrong with this code!!!

Re: What's wrong with this code!!!

From: terryg8 <trg_at_ibm.net>
Date: 1997/10/21
Message-ID: <344CE5AC.6365@ibm.net>#1/1

Corncrowe wrote:
>
> >We can't really help you if we don't have an error message to >decipher.
>
> I was implying structure and flow rather than a specific error message.
>
> >> delete from temp_aging where ord_id is not null;
> >> commit;
>
> The delete temp_aging and commit statement...there is a cursor at the beginning
> of the transaction. The cursor is populated with a select statement from
> temp_aging, Later in the code fragment a delete statement is encountered.
> What is the purpose of the delete temp_aging at this point in the flow?
>
> I guess the question is to find mistakes in structure and point out how this
> stored procedure can be written differently. Think of it as an exercise of
> sorts.
>
> Thanks,
>
> Jon

The only thing I see questionable is the update of temp_aging.
Every row is to be updated so perhaps a straight update with subselect might be more efficient than the cursor select, ordvol select, and temp_aging update approach. A straight update statement would process temp_aging row by row without reselecting for each row. That's obvious I guess and I suspect you used the cursor approach because a single update statement just didn't perform as well.
Hope this helps, even though it probably doesn't. Terry Received on Tue Oct 21 1997 - 00:00:00 CDT

Original text of this message

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