[code language=”sql”]
#!/bin/bash
cat textfile.txt |while read Name
do sqlplus -s <a href="mailto:userid/password@db_name">userid/password@db_name</a> &gt; output.log &lt;&lt;EOF
set verify off
set heading off
select customerid  
from customers  
where customername like ‘%${Name}%’;
/ exit EOF
[/code]

Korn Shell Ref