Skip to content

Instantly share code, notes, and snippets.

@daicham daicham/gist:1593722
Created Jan 11, 2012

Embed
What would you like to do?
Export csv from a Oracle table by sqlplus
sqlplus -s << EOF > ${sdata_file}
${ora_user_name}/${ora_user_pass}@${ora_sid}
set echo off
set linesize 1000
set pagesize 0
set trimspool on
set trimout on
set feedback off
set colsep ','
select
id,
name,
to_char(created_at,'yyyy-mm-dd HH:MM')
from
table
where
to_char(created_at,'yyyy-mm-dd HH:MM') >= '2010-08-09 19:30';
EOF
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.