Run batch files without embedding the password
616019Jul 8 2009 — edited Jul 8 2009Hello all,
We are running some batch files in SQL that just spool data to file, my question is is there a way not to embedd the password in the batch file? I am running Ora 10g R2 on Windows 2003 server.
I tried looking up this info, but did not get too far. Let me know if you have any suggestions or point me to content that I can read.
.DAT file contents
C:\oracle\ora10g_r2\BIN\sqlplusw.exe USERNAME/PWD@HOST @c:\oracle\scripts\query2.sql
Query2.sql file contents
set feedback off
set heading off
set linesize 1350
set pagesize 0
column date_column new_value today_date
select 'KY'||to_char(sysdate,'yyyymmdd')||'1.txt' date_column
from dual;
spool c:\oracle\scripts\&today_date
select distinct
rpad(' ', 10)||
rpad(nvl(last_name, ' '), 50)||
rpad(nvl(first_name, ' '), 30)||
rpad(nvl(middle_name, ' '), 30)||
rpad(' ', 10)||
rpad(nvl(maiden_name, ' '), 50)||
rpad(' ', 30)||
rpad(nvl(birth_date, ' '), 8)||
rpad(nvl(gender, ' '), 1)||
lpad(id_ssn, 9, 0)||
decode(ethnic_group, 2, 1, 1, 2, 7, 3, 4, 4, 5, 5, 8, 6, 6, 7, 8)||
rpad(' ', 20)||
rpad(' ', 20)||
rpad(nvl(address_line1, ' '), 60)||
rpad(nvl(address_line2, ' '), 60)||
rpad(nvl(city, ' '), 35)||
rpad(nvl(st, ' '), 2)||
rpad(nvl(zip, ' '), 10)||
rpad(nvl(to_char(county_res), ' '), 3)||
rpad(' ', 4)||
rpad(lic#, 15)||
from transmission_tab;
spool off
exit;
Thank You,
Sandeep