mahesh chintala


{ City } chennai
< Country > india
* Profession * software
User No # 118417
Total Questions Posted # 1
Total Answers Posted # 1

Total Answers Posted for My Questions # 1
Total Views for My Questions # 2017

Users Marked my Answers as Correct # 1
Users Marked my Answers as Wrong # 0
Questions / { mahesh chintala }
Questions Answers Category Views Company eMail

how to retrieve data from different tables ,place this data in different excel worksheets.

Gap Inc,

1 Oracle General 2017




Answers / { mahesh chintala }

Question { Gap Inc, 2017 }

how to retrieve data from different tables ,place this data in different excel worksheets.


Answer

declare
cursor c1 is select e.empno,e.ename,e.sal,e.deptno,d.deptno dno,d.dname,d.loc from emp e,dept d where e.deptno=d.deptno;
fp utl_file.file_type;
cfilename varchar2(20);
begin
cfilename:='office'||to_char(to_date('2007','yyyy'),'yyyy')||'.xls'; /*specifying filename*/
fp:=utl_file.fopen('DATA_PUMP_DIR',cfilename,'w'); /*DATA_PUMP_DIR is a default directory*/
for i in c1 loop
UTL_FILE.PUT_LINE(fp,i.empno||i.ename||i.sal||i.deptno);
end loop;
utl_file.fclose(fp);
end;

Is This Answer Correct ?    1 Yes 0 No