我正在尝试从shell脚本连接到oracle数据库(我是一个新用户)。然后,该脚本将传递一个查询,并将结果传递给一个名为canadacount的变量。我已经写了代码,但它不能工作
#this script will attempt to connect to a remote database CFQ143 with user ID 'userid' and password 'password'.
#After loggin in it will read data from the PLATFORMSPECIFIC table.
#We can pass a query 'select count (platform) from platformspecific where platform='CANADA';
#The result from this query will be passed to a variable called canadacount which we can then echo back to the user.
canadacount='$ORACLE_HOME/bin/sqlplus -s /nolog<<EOF
connect userid/passsword@CFQ143:1521:CFQ143
set pages 0 feed off
select count (platform) from platformspecific where platform='CANADA';
exit
EOF'
echo $canadacount发布于 2015-03-27 02:13:05
答案是:
我将连接线更改为以下内容:
connect userid/passsword@CFQ143https://stackoverflow.com/questions/29281309
复制相似问题