I was wondering why the output is not being shown even if I set the SERVEROUPUT variable to ON.
I have the following annonymous block code:
DECLARE
v_rec_count number:=0;
BEGIN
for rec in (SELECT T_A.ROWID, T_A.OPEN_COUNT, T_B.OPEN_COUNT as NEW_OPEN_COUNT
FROM T_A
INNER JOIN T_B ON
T_A.KEYA = T_B.KEYA
AND T_A.KEYB = T_B.KEYB
AND T_A.OPEN_COUNT <> T_B.OPEN_COUNT)
loop
v_rec_count := v_rec_count + 1;
update T_A t1
set t1.OPEN_COUNT = rec.NEW_OPEN_COUNT,
t1.UPD_USER_ID = 'batch',
t1.UPD_DATE = SYSDATE
where t1.rowid = rec.rowid;
end loop;
dbms_output.put_line ('T_A UPDATE_TOTAL: ' || v_rec_count);
END;
/
When I execute the following code, I would like to see the output of dbms_output.put_line to the sql prompt and eventually to the log file when I run the sql file via sqlplus. The output that the block does is just the "PL/SQL Procedure has successfully run".
I already set SET SERVEROUPUT ON before the block but it does not work. Any ideas?