PLSQL_7_2_Practicee.docx - www.oracle.com/academy Database...

This preview shows page 1 - 3 out of 12 pages.

The preview shows page 1 - 3 out of 12 pages.
Database Programming with PL/SQL7-2:Trapping Oracle Server ExceptionsPractice ActivitiesVocabularyIdentify the vocabulary word for each definition below:Predefined Oracle ServerErrorsEach of these has a predefined name. For example, if the error ORA-01403 occurs when no rows are retrieved from the database in aSELECT statement, then PL/SQL raises the predefined exception-name NO_DATA_FOUND.PROGRAMAEXCEPTION_INITTells the compiler to associate an exception name with an Oracleerror number. That allows you to refer to any Oracle Server exceptionby name and to write a specific handler for it.SQLERMReturns character data containing the message associated with theerror numberNon-predefined OracleServer ErrorsEach of these has a standard Oracle error number (ORA-nnnnn) anderror message, but not a predefined name. We declare our ownnames for these so that we can reference these names in theexception section.SQLCODEReturns the numeric value for the error code (You can assign it to aNUMBER variable.)Try It / Solve It1.What are the three types of exceptions that can be handled in a PL/SQL block?
2.What is the difference in how each of these three types of exceptions is handled in the PL/SQLblock?
3.Enter and run the following PL/SQL block. Look at the output and answer the followingquestions:DECLAREv_numberNUMBER(6, 2) := 100;v_region_idregions.region_id%TYPE;v_region_name regions.region_name%TYPE;BEGINSELECT region_id, region_name INTO v_region_id, v_region_nameFROM regionsWHERE region_id = 1;DBMS_OUTPUT.PUT_LINE('Region: ' || v_region_id || ' is: ' || v_region_name);v_number := v_number / 0;END;A.What error message is displayed and why?

Upload your study docs or become a

Course Hero member to access this document

Upload your study docs or become a

Course Hero member to access this document

End of preview. Want to read all 12 pages?

Upload your study docs or become a

Course Hero member to access this document

Term
Spring
Professor
JORGE OMAR JASSO LUNA
Tags
Subroutine, Control flow

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture