oracle function/procedure/package 调试方法-凯发app官方网站

凯发app官方网站-凯发k8官网下载客户端中心 | | 凯发app官方网站-凯发k8官网下载客户端中心
  • 博客访问: 3977544
  • 博文数量: 536
  • 博客积分: 10470
  • 博客等级: 上将
  • 技术积分: 4825
  • 用 户 组: 普通用户
  • 注册时间: 2006-05-26 14:08
文章分类

全部博文(536)

文章存档

2024年(3)

2021年(1)

2019年(1)

2017年(1)

2016年(2)

2013年(2)

2012年(10)

2011年(43)

2010年(10)

2009年(17)

2008年(121)

2007年(252)

2006年(73)

相关博文
  • ·
  • ·
  • ·
  • ·
  • ·
  • ·
  • ·
  • ·
  • ·
  • ·

分类: oracle

2007-02-07 12:27:44

when you use sql*plus to submit pl/sql code, and when the code contains errors, you receive notification that compilation errors have occurred, but there is no immediate indication of what the errors are. for example, if you submit a standalone (or stored) procedure proc1 in the file proc1.sql as follows:
sql> @proc1

and, if there are one or more errors in the code, then you receive a notice such as the following:
mgr-00072: warning: procedure proc1 created with compilation errors

in this case, use the show errors statement in sql*plus to get a list of the errors that were found. show errors with no argument lists the errors from the most recent compilation. you can qualify show errors using the name of a procedure, function, package, or package body:

sql> show errors proc1
sql> show errors procedure proc1

see also:
sql*plus user's guide and reference for complete information about the show errors statement

note:
before issuing the show errors statement, use the set linesize statement to get long lines on output. the value 132 is usually a good choice. for example:
set linesize 132

assume that you want to create a simple procedure that deletes records from the employee table using sql*plus:

create or replace procedure fire_emp(emp_id number) as
   begin
      delete from emp_tab wher empno = emp_id;
   end
/

notice that the create procedure statement has two errors: the delete statement has an error (the e is absent from where), and the semicolon is missing after end.

after the create procedure statement is entered and an error is returned, a show errors statement returns the following lines:

show errors;

errors for procedure fire_emp:
line/col       error
-------------- --------------------------------------------
3/27           pl/sql-00103: encountered the symbol "empno" wh. . .
5/0            pl/sql-00103: encountered the symbol "end" when . . .
2 rows selected.

show errors在调试create function/ procedure/ package时非常有用, 让我找了好几天, 要不错了就一个"mgr-00072: warning: procedure proc1 created with compilation errors"很是郁闷, 自己也不知道错在什么地方了!

ref: oracle 10.2 document
阅读(4654) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~
")); function link(t){ var href= $(t).attr('href'); href ="?url=" encodeuricomponent(location.href); $(t).attr('href',href); //setcookie("returnouturl", location.href, 60, "/"); }
网站地图