Hi All,
We have an oracle 11.2 on Red-hat.
I am not plsql developer and trying to create a plsql procedure for our requirement.
We have table like emp_Temp,It has 100 rows,Just want to store those records in txt file or xls file or xml file .For that,i just preparing as below.
It is working fine when the table has rows but i have 2 issues
1, When the table has zero rows, exception is not working.
2, The output is not stored in the text file or excel file or xml file
set serveroutput on
spool Test.txt
or
set markup html on spool on
spool Test.xls
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
BEGIN
FOR rec IN (SELECT name FROM emp_temp )
LOOP
DBMS_OUTPUT.PUT_LINE ('Employee Number: ' || rec.name);
END LOOP;
EXCEPTION
WHEN NO_DATA_FOUND THEN
dbms_output.put_line('Customer does not exist');
END;
/
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Any Suggestions.
Thanks & Regards,