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


Please Help Members By Posting Answers For Below Questions

How to load data from external tables to regular tables?

541


What is an oracle database table?

598


Why does oracle 9i treat an empty string as null?

539


How to write date and time interval literals in oracle?

575


Assuming today is Monday, how would you use the DBMS_JOB package to schedule the execution of a given procedure owned by SCOTT to start Wednesday at 9AM and to run subsequently every other day at 2AM.

1507






What is dual table oracle?

527


In SAP ECC 6.0 , under DB02 tcode , Tablespace name to be explain stepy step all the col

3704


How to end the current transaction in oracle?

562


How to use values from other tables in update statements using oracle?

569


What are the attributes of cursor?

592


What are the different types of synonyms?

602


Explain oracle’s system global area (sga).

628


Is postgres faster than oracle?

561


What is concurrency in oracle?

548


How can I convert single byte kana characters into multi byte kana characters and vice-versa.

1936