Created
January 11, 2012 08:33
-
-
Save daicham/1593722 to your computer and use it in GitHub Desktop.
Export csv from a Oracle table by sqlplus
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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