How To Export Data Into
CSV File
Question:
I am having a table with 5 colulmns and 1 million
record how to export the data into a csv or sql file with some delimiter?
CREATE TABLE mytable(
c1 number,
c2 varchar2(40),
c3 varchar2(80),
c4 number,
c5 varchar2(8));
begin
FOR i IN 1..1000 loop
INSERT INTO mytable
VALUES (i, 'Test '||i, 'Data for test row '||i, mod(i,43)+1, 'Final');
end loop;
commit;
end;
/
SELECT c1||',"'||c2||'","'||c3||'",'||c4||',"'||c5||'"'
FROM mytable
spool DATA.csv
/
spool off
Have a Oracle Question
Do
you have an Oracle Question?
Oracle Books
Oracle Certification,
Database Administration, SQL, Application, Programming Reference Books
Oracle Application
Oracle
Application Hints and Tips
Oracle Home
Oracle
Database, SQL, Application, Programming Tips
All the site contents are Copyright © www.erpgreat.com
and the content authors. All rights reserved.
All product names are trademarks of their respective
companies.
The site www.erpgreat.com is not affiliated with or endorsed
by any company listed at this site.
Every effort is made to ensure the content integrity.
Information used on this site is at your own risk.
The content on this site may not be reproduced
or redistributed without the express written permission of
www.erpgreat.com or the content authors.
|