shell编程中如何执行oracle语句

shell编程中如果向oracle中插入数据之类的,需要先把执行语句放到文件中,然后再@这个文件执行

有如下俩种方式供参考:


SQL=`sqlplus user/pwd@orains <<EOF
@Sqlfile
exit
EOF
`
或者
echo "exit"|sqlplus user/pwd@orains @sqlfile

猜你喜欢

转载自www.cnblogs.com/watertaro/p/9220807.html