Im using Aqua Data Studio to debug a stored procedure by scattering output statuses.
I have a delete statement in a package that violates an integrity constraint:
DELETE FROM x WHERE x.ID = an_x_with_children;
My turn does not work with ORA-02292 on this line, as expected. I want to see the value of an_x_with_children variable. Therefore, I end the line with the following conclusions:
dbms_output.put('Attempting to delete x: ' || an_x_with_children); DELETE FROM x WHERE x.ID = an_x_with_children; dbms_output.put(' Success');
And expect to see the message as the last in the message console before the integrity error message. But he does not print!
Now, if I change the output to use the put_line() procedure as follows:
dbms_output.put_line('Attempting to delete x: ' || an_x_with_children); DELETE FROM x WHERE x.ID = an_x_with_children; dbms_output.put_line(' Success');
I see the message "Attempting to delete x: 123" immediately before proc errors.
docs for the dbms_output package dbms_output not mention the put and put_line , which behave differently in this respect. For example, he says
The output generated using PUT or PUT_LINE is buffered.
Therefore, I would expect both or none of them to show results with proc errors.
Can someone explain what happens to this behavior?
source share