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

What is logical backup in oracle?

644


How to define an anonymous procedure without variables?

628


Is oracle a programming language?

650


Explain the use of control file?

738


Is oracle a relational database?

606






20. Using a set operator, display the client number of all clients who have never placed an order.

1882


How much memory your 10g xe server is using?

682


Explain the use of parfile option in exp command.

628


Can we convert a date to char in oracle and if so, what would be the syntax?

637


What is define in oracle?

670


material view and view disadvantages?

711


In AP we done Customizations for Late Payments Charges. For Reporting Purpose What are the Documents Prepared for Customer Understanding??

1287


How to create a new table in your schema?

695


What are the attributes of cursor?

687


how to convert .db (extention) database file into .dmp (extention ) for oracle database ?

2166