Hi Folks,
I am executing an anonymous block by running a sql script and have given dbms_output.put_line statement but even after giving set serveroutput on I am not getting any output on the screen. Below is the code from the sql script and the output.
spool /home/anujk/scripts/execute_dml.log
set serveroutput on;
conn random/random
DECLARE
lv_count NUMBER:=0;
BEGIN
FOR i IN 1 .. 100000 LOOP
insert into random_generator values (random_seq.nextval,
DBMS_RANDOM.string('x',10),
DBMS_RANDOM.string('u',10),
DBMS_RANDOM.string('a',10),
DBMS_RANDOM.string('l',10)
);
END LOOP;
commit;
SELECT count(*)
INTO lv_count
FROM random.random_generator;
DBMS_OUTPUT.PUT_LINE('Total number of rows: '||lv_count);
EXCEPTION
WHEN OTHERS THEN
DBMS_OUTPUT.PUT_LINE('Error: '||SQLERRM);
END;
/
Output -
SQL> @execute_dml.sql
Connected.
PL/SQL procedure successfully completed.
I have 11.2.0.4 installed on oracle linux 6. Any leads will be greatly appreciated.
Thanks