Friday, August 7, 2009

Export sqlplus results to a csv file

Create the file buy_export.sql:
set echo off

set feedback off

set linesize 100

set pagesize 0

set sqlprompt ''

set trimspool on

spool buyInfo.csv


select buyid||','|| name
from dbbuy;

spool off

Run it using

sqlplus -S [username]/[password]@[SID] @buy_export.sql

Sphere: Related Content

1 comments:

..cik sha.. said...

hi.. i beginner here.need help.
i got csv file. i can load the csv file into stringgrid using delphi. now i want that csv file been insert to table. i'm using oracle 9i.