DBMS_OUTPUT and Debugging
Writes to an in-memory buffer your client prints after the block finishes — not a live console.
How it works
DBMS_OUTPUT.PUT_LINE writes to an in-memory buffer that your client (SQL*Plus, SQL Developer, etc.) reads and prints after the block finishes — it isn't a live console, and shows nothing unless the client has SERVEROUTPUT turned ON with a buffer large enough for what's being printed. For anything beyond quick ad hoc tracing, most environments prefer a real logging table or an IDE-integrated debugger, since DBMS_OUTPUT is invisible to a caller that isn't specifically watching for it — a scheduled job, a REST call.
SET SERVEROUTPUT ON SIZE UNLIMITED;
BEGIN
DBMS_OUTPUT.PUT_LINE('Starting batch...');
FOR v_i IN 1..3 LOOP
DBMS_OUTPUT.PUT_LINE('Processing row ' || v_i);
END LOOP;
DBMS_OUTPUT.PUT_LINE('Done.');
END;
/Related questions
Model-generated, grounded against the curated knowledge layer. Check specifics against your instance.