创建shell 文件 test.sh
echo "-------------->>>>>begin"
#define sql variable
SQL="isql -Sserver -Uuser -i/home/sqlfile.sql"
echo "password" | $SQL >> isql_log.log
echo "-------------->>>>>end"
创建SQL文件sqlfile.sql
print "-------sqlfile----->>>begin"
select * from Table_test
print "-------sqlfile----->>>end"
go
执行shell脚本
chmod +x test.sh
./test.sh
注意:
一条SQL语句中不允许多余的换号,最后才可以用go提交