Hello! Tell me, please, why can the same procedure in pl / sql produce a different result? When you first start - we get the right result, when you restart it in this window - we get the wrong. Tried cleaning cash, set commit (wherever possible), but did not help. Maybe someone came across and will be able to help?

  • 2
    If the procedure is not very large, quote the text - Viktorov
  • Generally speaking, I would not start with cleaning the cache and commits, but with debugging the procedure and finding out where the wrong value comes from. DBMS_OUTPUT , step-by-step debugging, that's all ... As you find the reason, it becomes immediately clear what to do next. - Dmitriy
  • Thank. The problem is that during the debag, it is not possible to view the execution of the procedure from the package of interest - there is apparently no access. Must be given to the analysis of the development apparently - Olga Tarasevich

1 answer 1

This can happen if a batch variable is used inside a procedure. The variable is initialized when the package is first accessed in a session. Then, for example, your procedure sets a new value for the variable, and it "lives" the entire session. Commit and cache do not affect it. And this new value is used in calculations and gives an error.

Accordingly, you have an error in the code, it should be looked for and corrected.