how to print line by line out in oracle stored procedure
<p>I am executing a stored procedure but it is failing at some point, 
Current error code is not helping me to find where and exactly what the error is
I wanted to know where it is exactly failing so wanted to print line by line output while executing. 
for eg  : </p>

<pre><code>    create or replace
    -- decaring required variable
    PROCEDURE "PROC_DATA_TABLE_DETAILS" IS
    FOR TABLEDETAILS IN (SELECT * FROM user_tables )
        LOOP

 dbms_output.put_line (TABLENAME);

    select NUM_ROWS INTO COUNTRECORDS from all_tables where owner not like 'SYS%'and TABLE_NAME = TABLEDETAILS.TABLE_NAME;

    FOR FIELDSDETAILS IN (SELECT * FROM USER_TAB_COLUMNS WHERE TABLE_NAME = TABLENAME)

         LOOP


FIELDNAME :=FIELDSDETAILS.COLUMN_NAME;

 dbms_output.put_line (FIELDNAME );

          execute immediate 'SELECT NVL(count(*),0) FROM ' ||TABLENAME || ' WHERE '|| FIELDNAME || ' is not null ' into TEMPNONBLANK;
    END LOOP;

     INSERT INTO DATA_TABLE_DETAILS VALUES  (TABLEDETAILS.TABLE_NAME,COUNTFIELDS)

    END LOOP;

    END PROC_DATA_TABLE_DETAILS;
</code></pre>