Re: Stored Proceedure Not doing anything...?
Once the declaration of _new_category_id is moved above the cursor declaration, it compiles.
However ...
(i) the logic is suspect. the product_id value that's just been inserted should be retrieved with last_insert_id(), not with select max(prodct_id...), which can return the wrong value.
(ii) It's poor practice to write table identifers in camel or "Hungarian" case.
(iii) it does no error handling or reporting. and since it's supposed to be writing data, it should.
You have the tables & data, we don't, so only you can debug it. The method is to write Select stubs showing how each step proceeds.
Whether it otherwise behaves according to the spec, I can't tell without the tables and sample data.
Subject
Views
Written By
Posted
1047
June 02, 2018 07:04AM
570
June 02, 2018 07:24AM
Re: Stored Proceedure Not doing anything...?
626
June 02, 2018 11:27AM
700
June 02, 2018 12:33PM
539
June 02, 2018 02:44PM
Sorry, you can't reply to this topic. It has been closed.
Content reproduced on this site is the property of the respective copyright holders.
It is not reviewed in advance by Oracle and does not necessarily represent the opinion
of Oracle or any other party.