用于连接到Sybase DB以检索表数据的Unix Shell脚本

用于连接到Sybase DB以检索表数据的Unix Shell脚本,shell,unix,ksh,Shell,Unix,Ksh,我需要一个连接到Sybase DB的unix shell/perl脚本来检索表中的前3列数据 我尝试了以下代码: #!/bin/ksh results=`isql -U<username> -P<password> -S<server name> <<EOF select name from sysobjects where type = "U" go EOF` line_count=0 echo "${results}" | while rea

我需要一个连接到Sybase DB的unix shell/perl脚本来检索表中的前3列数据

我尝试了以下代码:

#!/bin/ksh

results=`isql -U<username> -P<password> -S<server name> <<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
#/bin/ksh

results=`isql-U-P-S你试过什么吗,或者你只是想得到一个直接的答案。嗨。我试着用korn脚本。现在我也修改了这个问题。请检查并帮助我好吗?您是否安装了
isql
?你能自己从命令行运行它吗?