如何找到导致ora-06575的错误? [英] How to find the error causing ora-06575?

查看:156
本文介绍了如何找到导致ora-06575的错误?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

最近我不得不编写一个oracle函数,并且错误ora-06575突然出现了很多. 通常是因为分配中缺少冒号,例如:z = 5(vs. z:= 5) 或错过的';'在声明的结尾.

Recently I had to write an oracle function, and the error ora-06575 popped up awfully a lot. Usually it was because of missing colon from assignment, such as: z = 5 (vs. z := 5) Or a missed ';' at the end of a statement.

无论如何,我能够创建该函数,但是它在执行过程中由于该错误而失败,并且没有提示问题出在哪里(除了它在函数中).

Anyway, I was able to create the function, but it failed during execution with that error, and gave no hint as to where the problem was (except that it was in the function).

我在MSSQL和Sybase中编写了相同的函数,而这两个函数实际上都试图将我指向任何错误的地方.所以我想我在Oracle中做错了-它不能仅仅告诉我有错误".

I wrote same function in MSSQL and Sybase, and both of those actually tried to point me to the place of any errors. So I figure I'm doing something wrong in Oracle - it can't just tell me 'there's an error'.

在oracle中,我有这样的声明:

In oracle I have a statement like this:

CREATE OR REPLACE
  FUNCTION...

我正在通过选择SQL函数的功能,然后按F9来编译该函数. 当我选择一条执行该函数的语句并按F9时,出现ora-06575错误.

I'm compiling the function from SQL developer by selecting the function, and pressing F9. When I select a statement which executes the function, and press F9, I get the ora-06575 error.

如果我按F5编译该函数,它将告诉我:

If I press F5 to compile the function, it tells me:

ORA-24344: success with compilation error

  Compiled.

所以我找到了以下网站: http://www.dba-oracle.com/t_ora_24344_success_with_compilation_error. htm 但是我似乎无法运行显示错误".运行它时,看不到任何输出.

So I found this website: http://www.dba-oracle.com/t_ora_24344_success_with_compilation_error.htm But I can't seem to run 'show errors'. When I run it, I get no output that I can see.

那只能在sqlplus中起作用吗?我使用的是SQL开发人员,我更愿意坚持使用SQL开发人员. 有什么我想念的吗?我希望它告诉我错误在哪里.

Can that only work from sqlplus? I'm using SQL developer, I'd prefer to stick to SQL developer. Is there something I'm missing? I want it to tell me where the error is.

推荐答案

SHOW ERRORS是sql * plus命令
您还可以查询USER_ERRORS视图

SHOW ERRORS is a sql*plus command
You can also query the USER_ERRORS view

SELECT line, position, text
FROM user_errors
WHERE name = '<<your_object_name>>'

这篇关于如何找到导致ora-06575的错误?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆