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

What is a Synonym ?

3 Answers  


Will the Optimizer always use COST-based approach if OPTIMIZER_MODE is set to "Cost"?

1 Answers  


What do you understand by a database object?

0 Answers  


What privilege is needed for a user to connect to oracle server?

0 Answers  


How many types of cluster table in Oracle?

0 Answers   MCN Solutions,


17. Display the order number and average item cost for each order.

1 Answers   Wipro,


What is the difference between translate and replace in oracle?

0 Answers  


What is RULE-based approach to optimization ?

1 Answers  


How to update values in a table in oracle?

0 Answers  


Explain the use of indexes option in imp command.

0 Answers  


What is OCI. What are its uses?

1 Answers  


What is the use of file param in imp command?

0 Answers  


Categories
  • Oracle General Interview Questions Oracle General (1808)
  • 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)