今天状态非常不好,头晕的要命。简单记录一下。
今天pl/sql challenge出的题目是关于package中删除一个存储过程的,打完看了一下oracle文档,完全错了。
首先,package中并不需要有执行部分,也就是说不用
“begin
……”
只包含存储过程就行了,把调用放到其他过程或匿名块中就ok。
其次,alter package没有删除procedure的语法,以下是文档截图:
不指定schema时默认是当前schema
debug与在compiler_parameters_clause中指定PLSQL_DEBUG = TRUE效果相同,保留信息用于pl/sql debugger
package、specification、body分别指定了对整个包、包声明、包体进行重编译。
compiler_parameters_clause:可以指定PLSQL_OPTIMIZE_LEVEL, PLSQL_
CODE_TYPE, PLSQL_DEBUG, PLSQL_WARNINGS, and NLS_LENGTH_SEMANTICS.,每个参数在语句中只能指定一次,对指定的包生效,如果要指定所有包,需要使用alter session或alter system命令
reuse settings:保留当前的编译选项设置
看来不能用alter语句进行存储过程删除等操作。
实验:
SQL> alter package pck_ref compile;
Package altered
During recompilation, Oracle Database drops all persistent compiler switch
settings, retrieves them again from the session, and stores them at the end of
compilation. To avoid this process, specify the REUSE SETTINGS clause.
SQL> alter package pck_ ref compile reuse settings;
Package altered
当发生编译错误时,可以用show error查看
SQL> alter package pck _ref compile reuse settings;
Warning: Package altered with compilation errors
SQL> show error;
No errors for PACKAGE NBSCMP.PCK_ REF
与包的修改选项类似,可以使用alter procedure命令:
来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/26451536/viewspace-751755/,如需转载,请注明出处,否则将追究法律责任。
转载于:http://blog.itpub.net/26451536/viewspace-751755/