ORA_JAVA.LAST_ERROR
built-in functionThis function returns the error text of the last PL/SQL exception that occurred
when calling Java from PL/SQL. Use when the PL/SQL exception raised is ORA_JAVA.JAVA_ERROR
.
Note that if you do not add explicit exception handlers to your code, then these Oracle errors might be thrown instead of a named exception:
ORA-105100this is synonymous with ORA_JAVA.JAVA_ERROR
ORA-105101this is synonymous with ORA_JAVA.EXCEPTION_THROWN
FUNCTION ORA_JAVA.LAST_ERROR RETURN VARCHAR2;
Whenever you issue a call to a Java method in a PL/SQL block, it is good practice
to use this built-in in the exception-handling part of the calling block to
handle the ORA_JAVA.JAVA_ERROR
type of PL/SQL exception. Note that when ORA_JAVA.JAVA_ERROR
is thrown, this doesn't indicate that an exception was thrown from within the
Java method that was being called.
/*
** Example of an invalid array element error.
*/
PROCEDURE foo IS
arr ORA_JAVA.JARRAY;
n PLS_INTEGER;
BEGIN
...
arr := ORA_JAVA.NEW_BYTE_ARRAY(5);
n := ORA_JAVA.GET_BYTE_ARRAY_ELEMENT(arr, 5);
...
EXCEPTION
WHEN ORA_JAVA.JAVA_ERROR THEN
OFM_MESSAGE(' Alert: ' || ORA_JAVA.last_error);
END;
Copyright © 1984, 2005, Oracle. All rights reserved.