How to find the error causing ora-06575?

匆匆过客 提交于 2019-11-29 11:41:06

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>>'

SHOW ERRORS works in SQL*Developer too (at least in the versions I've used recently, certainly 3.1). You mentioned in a comment that you're connected as SYS, so I really hope you're creating your function explicitly in another schema - I'd avoid this anyway just in case you forget one day, and modifying any of the pre-built schemas (SYS, SYSTEM etc.) is a bad idea. If so you need to prefix the errored object with the schema too:

create or replace function my_schema.x return number is
begin
    return sysdate;
end;
/
show errors my_schema.x

When run as a script (F5) this says:

FUNCTION X compiled
Warning: execution completed with warning
3/8    PLS-00382: expression is of wrong type
3/1    PL/SQL: Statement ignored

The first two lines of the output come from the function compilation, the last two from show errors. You can also run the two statements separately with F9 to see the same results.

But I'm not sure how you're getting the ORA-24344, so maybe you're on an earlier version; and it's possible that won't work. A.B.Cade's solution will work whatever your client though.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!