首页 > 数据库技术 > 详细

SQL语句——20、sqlplus与shell结合

时间:2020-01-05 10:04:29      阅读:90      评论:0      收藏:0      [点我收藏+]
[oracle@dba ~]$ cat a.sh
#!/bin/bash
TAB=emp

sqlplus -s scott/password << EOF | awk NR != 1 && $2 ~ /S.*T/{print $2,$6}
set head off
set feed off
select * from $TAB;
exit;
EOF
[oracle@dba ~]$ ./a.sh
SMITH 800
SCOTT 3000

SQL语句——20、sqlplus与shell结合

原文:https://www.cnblogs.com/marxist/p/12151208.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!