how to retrieve data from different tables ,place this data in different excel worksheets.
Answer Posted / mahesh_ch
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 |
Post New Answer View All Answers
Can we protect our pl/sql source code?
Explain the function of optimizer in oracle?
What is a connect identifier?
What is a oracle database?
Give the various rollback segment states.
What is bulk load in oracle?
How to convert dates to characters in oracle?
Can we write insert statement in function in oracle?
How to set up autotrace for a user account?
How does oracle handle read consistency?
Why cursor variables are easier to use than cursors?
Why does Oracle not permit the use of PCTUSED with indexes?
What is the difference between hot backup and cold backup in oracle?
What is meant by a deadlock situation?
What is a proxy object?