Question: Assignment 1 0 - 2 : Using theDBMS _ DDLPackageBecause Brewbean s is in the middle of constructing its application and making severaldatabase modifications, the
Assignment : Using theDBMSDDLPackageBecause Brewbeans is in the middle of constructing its application and making severaldatabase modifications, the developers are going to build a procedure to recompile all invalidobjects automatically Start SQL Developer, if necessary Type and run the following code:SELECT objectname, statusFROM userobjectsWHERE objecttype 'PROCEDURE'; If you see theBBJOBTESTprocedure listed with aVALIDstatus onscreen, skip to Step If this procedure doesnt exist, proceed with Step Open theassignmenttxtfile in the Chapter folder, and use its code to create theBBJOBTESTprocedure.
Type and run the following code:SELECT objectname, statusFROM userobjectsWHERE objecttype 'PROCEDURE'; Verify that the query results listBBJOBTESTwith aVALIDstatus, which tells you theprocedure exists Type and run the following statement to modify the BBJOBQ table. Because theBBJOBTESTprocedure uses this table, the procedure changes to the statusINVALID,indicating the need for recompiling.ALTER TABLE bbjobqMODIFY msg VARCHAR; Type and run the following query to confirm the statusINVALID:SELECT objectname, statusFROM userobjectsWHERE objecttype 'PROCEDURE'; Create an anonymous block, using DBMSDDLALTERCOMPILE to compile all INVALID objects using an IF THEN ELSE LOOP. To simplify this process, retrieve all the INVALID objects in a cursor. Run the anonymous block Type and run the following query to confirm that these objects status is nowVALID:SELECT objectname, statusFROM userobjectsWHERE objecttype 'PROCEDURE';
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
