Reputation: 1122
I'm creating a Java application which connects to an oracle database via JDBC and is able to execute scripts on in. Somewhat like toad. The reason I am creating this is because we can't use Toad or SQLplus in our closed working space.
Everything is working great until I come to procedures,functions,triggers,packages,... (the most important items to say).
I am able to send them trough the JDBC driver, but it always says it is succesfull, even when it wasn't. In SQLplus you get a message saying '.... created with compilation errors', so in fact it isn't a real error either. but then you are able to show the errors.
Is there a way to acces those errors you get with show errors
via JDBC? So I atleast now is an error occured.
Upvotes: 1
Views: 1201
Reputation: 23747
You can use system view ALL_ERRORS
Example:
select *
from ALL_ERRORS
where owner = 'your_schema'
and name = 'your_package_name'
and type = 'PACKAGE BODY'
order by sequence
Upvotes: 2