title: Unix Shell Script to Connect to Sybase DB to retrieve table data
body: <p>I need a unix shell/perl script which connects to Sybase DB to retrieve first 3 columns data in a table</p>
  
  <p>I tried below code:</p>
  
  <pre><code>#!/bin/ksh
  
  results=`isql -U&lt;username&gt; -P&lt;password&gt; -S&lt;server name&gt; &lt;&lt;EOF
  select name from sysobjects where type = "U"
  go
  EOF`
  line_count=0
  echo "${results}" | while read line; do
     echo "Line $((line_count = line_count + 1)) is ${line}"
  done
  </code></pre>
  
  <p>But when I execute this code i am getting error as isql not found. So I suspect that I have to set some environment before running this script. I have jdk and jconn3 jar ready with me. So can u please help me knowing how to set the environment in my script ?</p>