ITPub博客

首页 > 数据库 > Oracle > sqlplus小窍门:执行操作系统命令(zt)

sqlplus小窍门:执行操作系统命令(zt)

原创 Oracle 作者:trigger_lau 时间:2010-05-01 08:48:38 0 删除 编辑

我们知道,在sqlplus中,可以使用!或者host来执行操作系统命令,但是在windows上,!是不能使用的。

NinGoo@windows>!hostname
SP2-0042: unknown command “!hostname” – rest of line ignored.

NinGoo@windows>host hostname
bepdg00726-xp

实际上,windows平台(还有其他如os/390,VMS)上,可以使用$来代替host

NinGoo@windows>$hostname
bepdg00726-xp

另外,host也好,$也好,命令中还可以使用变量替换

NinGoo@windows>define hostname=”time /t”

NinGoo@windows>host &&hostname
04:03 PM

NinGoo@windows>$&&hostname
04:04 PM

[@more@]
link:http://www.ningoo.net/html/2007/sqlplus_tips_execute_os_command.html

来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/9826/viewspace-1033232/ ,如需转载,请注明出处,否则将追究法律责任。

下一篇: Tips:压缩记账法
请登录后发表评论 登录
全部评论

注册时间:2008-03-13

  • 博文量
    192
  • 访问量
    1412677