Write a procedure to genearte a report of all employee with managers name details with | (pipe delimiter) in unix development server /tmp path.
Example:** Emp ID|Emp Name|Manager Name|Sal|Dept No|Location -------header** 7369|SMITH|FORD|800|20|DALLAS
Total Record|1 ------Trailer
f_handle2 utl_file.file_type;
begin
f_handle2 := utl_file.fopen(
'TESTING_DIR' -- File location
, 'EMP_DET_WITH_MANA_NAME2' -- File name
, 'w'); -- Open mode: w = write.
for i in (select empno,ename,manager_name,sal,deptno,loc,count(empno) from t77)
loop
utl_file.putf(f_handle2,i.empno||'|'||i.ename||'|'||i.manager_name||'|'||i.sal||'|'||i.deptno||'"'||i.loc);
UTL_FILE.NEW_LINE(f_handle2);
end loop;
utl_file.fclose(f_handle2);
exception
when others then
dbms_output.put_line('ERROR: ' || SQLCODE || ' - ' || SQLERRM);
raise;
end;