stack trace: java.sql.SQLException: ORA-01403: no data foundThere are two parts to this package, the package itself and its body. I'm not sure which file this error implicates. The package itself (looking at SQL Developer) is:
ORA-06512: at "MYSCHEMA.MY_PACKAGE", line 144
ORA-06512: at line 1
Oracle procedures should have an exception handler that logs relevant information to a log table (using a logging package/procedure defined as AUTONOMOUS_TRANSACTION). The exception handler should then re RAISE the exception so that the client application receives it.Good point, I should try to do this. How?
DECLARE> temp_var VARCHAR2(30);
emp_column VARCHAR2(30) := 'last_name';
table_name VARCHAR2(30) := 'emp';
BEGIN> SELECT COLUMN_NAME INTO temp_var FROM USER_TAB_COLS
temp_var := emp_column;
-- processing hereCan you modify this example to show how to log an exception in a table using AUTONOMOUS_TRANSACTION?
temp_var := table_name;
SELECT OBJECT_NAME INTO temp_var FROM USER_OBJECTS
WHERE OBJECT_NAME = UPPER(table_name)
AND OBJECT_TYPE = 'TABLE';
-- processing here
-- Catches all 'no data found' errors
WHEN NO_DATA_FOUND THEN
('No Data found for SELECT on ' || temp_var);
SELECT a_column_name INTO out_number_of_pts FROM my_table WHERE user_name = myVar1Presuming that this is the proc that is running then Oracle is telling you that the match isn't occurring.