title: Extract one by one data from Database through Shell Script
body: <p>I have to code in Korn Shell. I have to take data from one database; and create "insert into" statements in a .sql file. And run this .sql file in another database.</p>
  
  <p>There are 24 columns in the table; I'm not able to extract data from that table one by one in order to create insert into statement.</p>
  
  <p>Can anyone help me with the same?</p>
  
  <p>I wrote the following code till now(just a sample, with two columns data)</p>
  
  <pre><code>$ cat analysis.sh
  #!/bin/ksh
  
  function sqlQuery {
  
  ied sqlplus -s / &lt;&lt; 'EOF'
  
  DEFINE DELIMITER='${TAB_SPACE}'
  
  set heading OFF termout ON trimout ON feedback OFF
  set pagesize 0
  
  SELECT ID, H00
  FROM SW_ABC
  WHERE ID=361140;
  
  EOF
  }
  eval x=(`sqlQuery`)
  ID=${x[0]}
  HOUR=${x[1]}
  
  echo ID is $ID
  echo HOUR is $HOUR
  </code></pre>
  
  <p>But here eval is not working. </p>