在sqlplus中如何使用系统的环境变量?

[复制链接]
查看11 | 回复2 | 2005-10-30 17:05:33 | 显示全部楼层 |阅读模式
我在solaris中利用shell产生每天的数据库及系统check的报表文件名,该文件名在我的shell脚本中付给一个临时环境变量,我现在在相应的oracle的sql脚本中也需要使用该环境变量将该oracle脚本的运行结果存入该文件。
我在oracle的脚本中该如何使用该环境变量?
回复

使用道具 举报

千问 | 2005-10-30 17:05:33 | 显示全部楼层
aaa$export TEST=test
aaa$sqlplus /nolog
SQL*Plus: Release 9.2.0.4.0 - Production on Wed Sep 6 00:06:03 2006
Copyright (c) 1982, 2002, Oracle Corporation.All rights reserved.
@>conn /
Connected.
@>spool $TEST.log
@>select * from tab;
no rows selected
@>spool off
@>!ls
datadmpJametongscriptsoftspoolsqltest.logwork
@>!ls -l $TEST.log
-rw-rw-r--1 adminadmin
52 Sep6 00:06 test.log
@>
回复

使用道具 举报

千问 | 2005-10-30 17:05:33 | 显示全部楼层
谢谢2楼的
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

主题

0

回帖

4882万

积分

论坛元老

Rank: 8Rank: 8

积分
48824836
热门排行