[nir@dba etl]$ cat login.sql
col TAB# new_value TAB NOPRINT
select chr(9) TAB# from dual;
set markup csv on delimiter "&TAB" quote off
set heading off termout off echo off feedback off verify off numformat 99999999999.9999999999999 null '\N'
[nir@dba etl]$ cat a.sh
#!/bin/bash
export ORACLE_PATH="/home/nir/etl"
echo "select * from dms_u.test_etl_source;" | sqlplus -s ${USER}/${PASS}@${TNS}
[nir@dba etl]$ ./a.sh
aa \N aa
\N aa aa
aa aa \N
\N \N aa
\N aa \N
aa \N \N
\N \N \N
aa aa aa
我正在使用 将输出login.sql
设为sqlplus
tsv。我想要的是在没有任何输出的情况下运行login.sql
。如果我将其放入glogin.sql
会-s
起作用。但我需要 tsv 登录仅在特定情况下发生(因此ORACLE_PATH
)。
所以我想a.sh
返回:
[nir@dba etl]$ ./a.sh
aa \N aa
\N aa aa
aa aa \N
\N \N aa
\N aa \N
aa \N \N
\N \N \N
aa aa aa
更改
login.sql
自:到: