title: open sqlplus connection only once in while loop
body: <p>I have 100 records. When I am running the code below, the SQL*Plus connection is opening many times utilizing 100% of CPU. Is there any way in which I could open SQL*Plus connection only once, i. e. outside <code>while</code> loop?</p>
  
  <pre><code>**#!/bin/bash
  export ORACLE_HOME=/software/oracle/ora10204
  export PATH=$PATH:$ORACLE_HOME/bin
  INPUT_FILE='file.csv'
  IFS=','
  i=0
  while read name id do
  a[i]="$name"
  b[i]="$id"
  echo "${a[$i]}  ${b[$i]}"
  set serveroutput on;
  sqlplus .../...@'(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=...)(HOST=...)(PORT=...)))(CONNECT_DATA=(SID=...)))'&lt;&lt;EOF
  insert into code_entry(inh_valu,edi_valu) values('${a[$i]}' , '${b[$i]}');
  EOF
  let i=$i+1
  done &lt; $INPUT_FILE**
  </code></pre>