1. 程式人生 > >批量查詢資料庫內容

批量查詢資料庫內容

#/bin/bashname=`cat 2.txt`for i in $namedo sqlplus -S mintrade/HTCH2017htch << EOF set heading off feedback off verify off SELECT f_sign_account FROM TRADE.T_F_B_DEALER_BANK_RELATION WHERE f_bank_account='$i'; exit;EOFdone-S 去除sqlplus進入資料庫內容set heading off feedback off verify off 去除表頭user=`cat 2.txt`name=`for i in $userdosqlplus -S trade09/trade09 <<EOFset heading off feedback off verify off SELECT f_id FROM T_DEALER where f_code='$i';exit;EOFdone`for i in $namedosqlplus -S trade09/trade09 <<EOFset heading off feedback off verify off SELECT f_name FROM T_DEALER where f_id='$i';exit;EOFdone