click below
click below
Normal Size Small Size show me how
PL/SQL Database F2
| Question | Answer |
|---|---|
| PL/SQL records contain one or more components/fields of any _______ or composite type. | SCALAR |
| DECLARE v_emp_record employees%rowtype; DBMS_OUTPUT.PUT_LINE('Email for ' || _____________.first_name ||' ' || ____________.last_name); END; What is missing in the DBMS_OUTPUT section? | V_EMP_RECORD |
| Line #8 contains an error. | False |
| The FETCH statement positions the cursor pointer at the first row. | False |
| In exception section, the WHEN clause if followed by _______. | EXCEPTION_NAME |
| What is missing in the given exception syntax? ____ EXCEPTION WHEN exception1 [OR exception2 . . .] statement1; statement2; | THEN |
| Handle named exceptions whenever possible, instead of using ______ in exception handlers. | OTHERS |
| Code that defines the recovery actions to be performed when execution-time errors occur. | EXCEPTION HANDLER |
| When an exception is raised, control immediately shifts to the _______ and the appropriate handler in the exception section is executed. | EXCEPTIONS SECTION |
| In exception section, the WHEN clause if followed by a condition. | False |
| Always add exception handlers whenever there is a possibility of an error occurring. | True |
| Exception section is mandatory in PL/SQL block. | False |
| An exception occurs when an error is discovered during the execution of a program that disrupts the normal operation of the program. | True |
| When an exception is raised, the rest of the execution section of the PL/SQL block is not executed. | True |
| You can use the EXCEPTION_INIT procedure to return user-defined error messages from stored subprograms. | False |
| Names for predefined exceptions must be declared in the declaration section. | False |
| User-defined exceptions are declared within the declarative section and are raised explicitly. | True |
| Pragma declaration is used in declaring non-predefined exceptions. | True |
| Non-predefined exceptions has a standard Oracle error number (ORA-#####) and error message, but not a predefined name. | True |
| Each exception handler is consists of a _____ clause, which specifies an exception name. | WHEN |
| The NO_DATA_FOUND is a _______ exception. | PREDEFINED |
| The _______________ is used in non-predefined exception to tell the compiler to associate an exception name with a specific Oracle error | PRAGMA EXCEPTION INIT |
| What is the first step in handing non-predefined exception? | Exception name declaration |
| In trapping a user-defined exception, these steps must be followed: DECLARE -> RAISE -> __________. | Exception Handling |
| The %ROWTYPE cannot be used to declare a record based on another record. | True |
| The following declaration is a PL/SQL syntax for defining a record. Record_name table_name%rowtype; | True |
| The given syntax in declaring a user-define record is correct. TYPE type_name IS RECORD (field_declaration[,field_declaration]...); identifier type_name ; | True |
| BEGIN FOR cur_emps IN v_emp_record LOOP EXIT WHEN cur_emps%ROWCOUNT > 5; DBMS_OUTPUT.PUT_LINE(v_emp_record.employee_id || ' ' || v_emp_record.last_name); END LOOP; END; What will cause an error in the FOR section? | cur_emps IN v_emp_record |
| What is missing in line 8? OPEN ___ | Cur_emps |
| DECLARECURSOR cur_empsSELECT employee_id, last_name FROM employees;BEGINFOR cur_emps IN v_emp_record LOOP EXIT WHEN __________%ROWCOUNT > 5;DBMS_OUTPUT.PUT_LINE(_____________.employee_id || ' ' || __________.last_name); What is missing in line#6? | CUR_EMPS |
| What is missing in line#9? ______ EXIT WHEN ____%NOTFOUND | COUNTRY_CURS |
| What is the parameter mode of the formal parameter?_____ | IN |
| You must include the FOR UPDATE clause in the cursor query so that the rows are _____ on OPEN. | LOCKED |
| The missing element in in line 6 is 5. | True |
| You must include the FOR UPDATE clause in the cursor query so that the rows are unlocked on OPEN. | False |