SQLPLUS 向SHELL传递变量
2011-05-07 20:28
274 查看
[oracle@jumper oracle]$ cat a.sh
sqlplus -S "/ as sysdba" << !
set heading off
col today noprint
column today new_val dat
select to_char( sysdate, 'yyyy-mm-dd') today from dual;
host echo 'today is ' &dat
exit;
exit;
!
[oracle@jumper oracle]$ ./a.sh
today is 2005-04-11
[oracle@jumper oracle]$
sqlplus -S "/ as sysdba" << !
set heading off
col today noprint
column today new_val dat
select to_char( sysdate, 'yyyy-mm-dd') today from dual;
host echo 'today is ' &dat
exit;
exit;
!
[oracle@jumper oracle]$ ./a.sh
today is 2005-04-11
[oracle@jumper oracle]$
相关文章推荐
- python和shell间变量互相传递
- awk与shell之间的变量传递方法
- shell与python间传递变量方法
- 如何在shell脚本里传递一个变量给awk
- linux入门之awk和shell变量传递
- python和shell变量互相传递的几种方法
- Shell 与 SQLPLUS 的 交互 ---- 参数传递 返回值
- 如何将c语言的变量传递给shell脚本使用
- awk与shell之间的变量互相传递方法
- 变量在shell脚本间的传递
- 父 shell,子 shell ,export 与 变量传递
- awk与shell之间的变量传递方法
- shell配置,选择,环境变量修改(ORACLE_HOME,ORACLE_SID),无法使用sqlplus
- Shell变量传递
- Oracle 从sql*plus向shell传递变量
- python和shell互相传递变量
- Shell向Perl脚本中传递变量的方法
- shell & awk 变量传递
- shell文本过滤编程(七):awk之变量传递
- shell & awk 变量传递+awk综合概要