Showing posts with label csv. Show all posts
Showing posts with label csv. Show all posts

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