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



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

Answer / 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

More Oracle General Interview Questions

How to load data from external tables to regular tables?

0 Answers  


i have a table and it has constraints and i want to get "ALTER TABLE table_name ADD CONSTRAINT constraint_name constraint type" this code must be in string type please help me if you want, i can give more explainings

2 Answers  


Who i will insert 1 lacks record in a Database table

4 Answers   TCS,


How to drop an index in oracle?

0 Answers  


What is difference between a formal and an actual parameter?

1 Answers  






How to filter out duplications in the returning rows using oracle?

0 Answers  


Hi can anyone tell me where are the dumps found of OCA certification.. Also the materials to be studied for the preparation.

2 Answers  


how to find find & delete duplicate rows from two different tables?

3 Answers   Accenture, TCS,


How to create lov dynamically at runtime & attach to text field?

0 Answers  


Explain do view contain data?

0 Answers  


WHAT IS ecc 6.0

0 Answers  


How to best split csv strings in oracle 9i?

0 Answers  


Categories
  • Oracle General Interview Questions Oracle General (1789)
  • Oracle DBA (Database Administration) Interview Questions Oracle DBA (Database Administration) (261)
  • Oracle Call Interface (OCI) Interview Questions Oracle Call Interface (OCI) (10)
  • Oracle Architecture Interview Questions Oracle Architecture (90)
  • Oracle Security Interview Questions Oracle Security (38)
  • Oracle Forms Reports Interview Questions Oracle Forms Reports (510)
  • Oracle Data Integrator (ODI) Interview Questions Oracle Data Integrator (ODI) (120)
  • Oracle ETL Interview Questions Oracle ETL (15)
  • Oracle RAC Interview Questions Oracle RAC (93)
  • Oracle D2K Interview Questions Oracle D2K (72)
  • Oracle AllOther Interview Questions Oracle AllOther (241)