Oracle Script to extract data from a table to a file in Putty .
Save below script in to a file let me name it as extract.sql .
Latter follow below steps to run above file.
Sqlplus username/password@databaseName
You will login in to this database and just use below syntax to run it.
@extract.sql
Depending on the data whatever size it may be it will be saved in to the file (given in the file)
set head off verify off termout off echo off feedback off pagesize 0 linesize 30000 trimspool on
set colsep |
define fname=filename.log
spool &fname
select 'Custname||'|'||Custaddress||'|'||Custaddress2||'|'||Custsubmittedname||'|'||Custsubmittedaddress1||'|'||Custsubmittedaddress2||'|'||Custaddress_error' from dual;
select Custname||'|'||Custaddress||'|'||Custaddress2||'|'||Custsubmittedname||'|'||Custsubmittedaddress1||'|'||Custsubmittedaddress2||'|'||Custaddress_error from CustomerAddressTable
spool off
No comments:
Post a Comment