日期:2014-05-16  浏览次数:20504 次

oracle的分号和斜杠(转)
引用
1. Adding a slash to the end of each statement was a bad choice because sqlplus treats slash as a buffer flush. For procedure/triggers/functions it is a must: because content of if is stored in the buffer and is not executed. However, for all other statements it means executing the same statement twice because such statement is executed immediately and put into buffer and following slash just re-executes the same statement.


我的理解是,对一些block,比如declare, begin end ,create procedure之类的,'/'是必须的,用来run
而一些简单statement,‘/ '会导致运行两次

问题是,直接用一个'/'就会运行两次,还是在分号之后还在下行跟着 / 才会执行两次?

另外,如果要避免重复执行的话,分号和斜杠是不是二选一就可以了,一般选哪个有啥习惯?
<!-- google_ad_section_end --><!--End_body//-->
?
?
  • 对我有用[0]
  • 丢个板砖[0]
  • 引用
  • 举报
  • 管理
  • TOP
回复次数:8<!-- | 浏览次数:<span csdnid="vcount" title="该帖阅读数为429">429</span>-->

?

<!-- google_ad_section_start(weight=ignore) -->
  • tangren用户头像
  • tangren
  • (老兵新手)
  • 等 级:
  • 3

    2

#1楼 得分:20回复于:2010-05-24 14:44:30
1、放在分号后面的 / 会导致两次;sqlplus认为输入“;”表示一个语句结束
2、分号
<!--End_rbody_65677030//-->
?
  • 对我有用[0]
  • 丢个板砖[0]
  • 引用
  • 举报
  • 管理
  • TOP
精华推荐:收集网易数据库笔试题,欢迎大家拍砖