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
Why do we use coalesce function in oracle?
Can we create trigger on materialized view in oracle?
How to empty your oracle recycle bin?
What to do if dba lost the system password?
How to loop through data rows in the implicit cursor?
Differentiate between pre-select and pre-query?
How many objectname will be created for a single table drop function? Why 'flashback' query giving error "ORA-38312: original name is used by an existing object" while getting the table?
How to initialize variables with default values?
How do we represent comments in oracle?
Design database draw er diagram for a certain scenario ?
What are the differences between char and nchar in oracle?
What is the difference between primary key and unique key and foreign key in oracle?
Can we convert a date to char in oracle and if so, what would be the syntax?
How to estimate disk space needed for an export job?
How do I reset a sequence in oracle?