SET SERVEROUTPUT ON DECLARE CURSOR C_INVALID_OBJECTS AS SELECT OBJECT_NAME, OBJE
ID: 3916473 • Letter: S
Question
SET SERVEROUTPUT ON
DECLARE
CURSOR C_INVALID_OBJECTS
AS
SELECT OBJECT_NAME, OBJECT_TYPE, STATUS
FROM USER_OBJECTS
WHERE STATUS = 'INVALID';
R_INVALID_OBJECTS C_INVALID_OBJECTS%ROWTYPE;
BEGIN
OPEN C_INVALID_OBJECTS;
FETCH C_INVALID_OBJECTS;
LOOP
EXECUTE DBMS_DDL.ALTER_COMPILE(R_INVALID_OBJECTS.OBJECT_TYPE, ‘HR’, R_INVALID_OBJECTS.OBJECT_NAME);
EXIT WHEN R_INVALID_OBJECTS%NOTFOUND;
END LOOP;
EXCEPTION
WHEN NO_DATA_FOUND THEN
DBMS_OUTPUT.PUT_LINE(‘No data found’);
END;
Step 2
Complete the remaining part as directed in the comment inside the BEGIN section of the anonymous block.
Alter the program to compile a table and demonstrate the exception catches (ORA-20002: Not a valid object type value.). (60%)
Explanation / Answer
ORA-20002:Error : Description. below the reason of this error.
object_name
Name of the procedure being described.
The syntax for this parameter follows the rules used for identifiers in SQL. The name can be a synonym. This parameter is required and may not be null. The total length of the name cannot exceed 197 bytes. An incorrectly specified OBJECT_NAME can result in one of the following exceptions:
ORA-20002 - The object that you specified is a remote object. This procedure cannot currently describe remote objects.
ORA-20002
ORU-10033: object 'X' is remote, cannot describe; expanded name 'Y'.
Parameter Descriptionobject_name
Name of the procedure being described.
The syntax for this parameter follows the rules used for identifiers in SQL. The name can be a synonym. This parameter is required and may not be null. The total length of the name cannot exceed 197 bytes. An incorrectly specified OBJECT_NAME can result in one of the following exceptions:
ORA-20002 - The object that you specified is a remote object. This procedure cannot currently describe remote objects.
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.