zoukankan      html  css  js  c++  java
  • Oracle execute and call

    --execute和call的区别
    -------------------------2014/01/14
    EXEC is a sqlplus command that put its argument as an anonymous pl/sql block: 'EXEC xxx' is transformed to 'BEGIN xxx; END;' 

    So you can use it to call a procedure, or do any pl/sql 

    It is documented here: 
    http://download.oracle.com/docs/cd/B19306_01/server.102/b14357/ch12022.htm#i2697931 

    CALL is a SQL statement that calls a stored procedure 
    It is the 'standard' way to call a procedure without doing pl/sql. 
    For example if you call a procedure from JDBC it uses CALL to call the procedure and return parameters. 

    It is documented here: 
    http://download.oracle.com/docs/cd/B19306_01/server.102/b14200/statements_4008.htm#BABDEHHG 

    Now about v$sql, I can see both: 

    SQL> call dbms_output.put_line('called'); 
    Call completed. 
    SQL> select sql_text from v$session join v$mystat using(sid) join v$sql on(v$sql.sql_id=v$session.prev_sql_id)where rownum=1; 
    SQL_TEXT 
    ------------------------------------------------------------------------------------------------------------------------------------ 
    call dbms_output.put_line('called') 

    SQL> exec dbms_output.put_line('executed'); 
    PL/SQL procedure successfully completed. 
    SQL> select sql_text from v$session join v$mystat using(sid) join v$sql on(v$sql.sql_id=v$session.prev_sql_id)where rownum=1; 
    SQL_TEXT 
    ------------------------------------------------------------------------------------------------------------------------------------ 
    BEGIN dbms_output.put_line('executed'); END; 
  • 相关阅读:
    VS2010下配置CxImage
    Visual Studio 2010 开发配置
    主机屋使用感受
    Web开发者必备的20款超赞jQuery插件
    自动页面居中
    jQuery+CSS打造的网页背景颜色切换效果
    小按钮,大学问
    【网站开发必备】——12款响应式 Lightbox(灯箱)效果插件
    修正 IE 的双倍页边距 bug
    a>b?a:b
  • 原文地址:https://www.cnblogs.com/jackhub/p/3518812.html
Copyright © 2011-2022 走看看