click below
click below
Normal Size Small Size show me how
DB ME
| Question | Answer |
|---|---|
| A ______ is used when the beginning and ending value of the loop is known. BASIC LOOP All the options FOR LOOP WHILE LOOP | FOR LOOP |
| In BASIC and WHILE loop, initialization of counter variable is done in No need to initialize Execution section Declaration section Declaration and execution section | Declaration section |
| Which of the following can have a null value? UPPER BOUND LOWER BOUND UPPER BOUND OR LOWER BOUND Not in the options | UPPER BOUND OR LOWER BOUND |
| Consider the given code fragment below. The condition will return a false value. A := null; B := null; IF A B THEN True False | False |
| An implicitly declared integer whose value automatically increases or decreases by 1 on each iteration of the loop is called: BOUND TER OUND | BOUND |
| In the cursor code, assume that the cursor contains 20 rows. How many rows will be fetched if the exit condition is %ROWCOUNT > 5? 6 20 5 1 | 6 |
| An explicit cursor will cause an error if: SELECT ... WHERE clause is missing Cursor declaration is syntactically incorrect All rows selected are fetched None of the above | Cursor declaration is syntactically incorrect |
| In the code below, what is missing in line 2 and 3? DECLARE CURSOR cur_emps ... FOR cur_emps IN v_emp_record LOOP ... RECORD VARIABLE TABLE Not in the options | RECORD |
| Is line 12 valid? DBMS_OUTPUT.PUT_LINE(v_empno ||''||v_iname); Invalid Valid | Invalid |
| The OPEN statement positions the cursor pointer at the first row. True False | True |
| The FETCH statement positions the cursor pointer at the first row. True False | True |
| The OPEN will populate the cursor's active set with the result of the SELECT statement in the cursor's definition? True False | True |
| The ______ is an optional exception-handling clause that traps any exceptions that have not been explicitly handled. OTHERS WHEN RAISE NULL | OTHERS |
| Always add ______ whenever there is a possibility of an error occurring. Exception handler Cursor Loop Not in the options | Exception handler |
| The following statements are examples of: Entering an expiration date that has passed Selecting more than one row into a single variable Receiving "no rows returned" from a select statement Exception Error Warning Not in the options | Exception |
| The term ______ in exceptions is the same as handling any error by including a corresponding exception handler. Exception handling RAISE WHEN OTHERS | Exception handling |
| The RAISE keyword is used by non-predefined exceptions. True False | True |
| The OTHERS is an optional exception-handling clause that traps any exceptions that have not been explicitly handled. True False | True |
| When an exception is raised, control immediately shifts to the exception section and the appropriate handler in the exception section is executed. True False | True |
| When an exception is raised, the rest of the execution section of the PL/SQL block is not executed. True False | True |
| An error occurs when an error is discovered during the execution of a program that disrupts the normal operation of the program. True False | True |
| The RAISE statement can be used to raise either user-defined or non-predefined exceptions. True False | True |
| Predefined exceptions have a standard Oracle error number (ORA-#####) and error message, but not a predefined name. True False | False |
| User-defined exceptions are declared within the declarative section and are raised explicitly. True False | True |
| Names for predefined exceptions must be declared in the declaration section. True False | False |
| Pragma declaration is used in declaring user-defined exceptions. True False | True |
| Two methods for raising an exception: Implicit, Explicit Predefined, Non-predefined | Implicit, Explicit |
| In trapping a user-defined exception, these steps must be followed: DECLARE -> RAISE -> ______ Not in the options Reference Identify Exception Exception Handling | Exception Handling |
| Each exception handler consists of a ______ clause, which specifies an exception name. CONDITION Not in the options WHEN | WHEN |
| You can use the ______ procedure to return user-defined error messages from stored subprograms. RAISE_APPLICATION_ERROR SOLCODE SQLERRM PRAGMA EXCEPTION_INIT | RAISE_APPLICATION_ERROR |
| The declared non-predefined exception is raised: IMPLICITLY EXPLICITLY | EXPLICITLY |
| Subprograms are implicitly shared. True False | True |
| Subprograms become the building blocks of packages and triggers. True False | True |
| You cannot invoke a procedure from inside an SQL statement. True False | True |
| In the given Procedure header, the underlined clause/keyword IS|AS is optional. True False | True |
| The block structure of the subprograms is similar to the structure of anonymous blocks. True False | True |
| The ______ parameters are declared in the parameter list of a subprogram specification. Formal Actual Positional Named | Formal |
| The code below is an example of passing parameters by ______ notation. add_dept('EDUCATION', 'D', 1400); Named Positional Combination IN OUT | Positional |
| Using an ______ parameter mode, you can pass a value into a procedure that can be updated within the procedure. IN OUT IN OUT | IN OUT |
| at is the other term for parameter? Argument Variable Expression Statement | Argument |
| The symbol for association operator is: => = : := | => |
| Which parameter mode can be assigned a default value? IN OUT IN OUT | IN |
| Given the procedure below, how many parameters will return a value to the calling environment? p_emp_id NUMBER, p_department_id OUT NUMBER, p_hiredate IN OUT DATE 1 2 3 | 2 |
| Which type of parameter passing uses an association operator? IN OUT Combination Positional Named | Named |
| If combination notation is used, the ______ parameters must come first. NAMED POSITIONAL | POSITIONAL |
| You can include exception handler in stored functions. True False | True |
| Parameters are optional in stored function. True False | True |
| When invoking a function as part of a PL/SQL expression, you can use a variable to store the return result. True False | True |
| A stored function may or may not return a value to the calling environment. True False | False |
| You cannot include exception handler in stored functions. True False | False |
| Which of the statements below is valid? Assuming get_sal function exists with no parameter. v_salary := get_sal() + 50; v_salary := get_sal + 50; get_sal + 50; get_sal() + 50; | v_salary := get_sal() + 50; |
| Which of the statements below is valid? Assuming get_sal function exists with a parameter. v_salary := get_sal() + 50; get_sal + 50; get_sal() + 50; Not in the options | Not in the options |
| What follows the RETURN keyword at the function header? VARIABLE IS DATATYPE PARAMETER | DATATYPE |
| In PL/SQL, the function identifier acts like a variable whose value depends on the parameters passed to it. PARAMETER STATEMENT EXPRESSION SELECT | EXPRESSION |
| Is the statement below valid? Assuming that get_sal procedure exists with one OUT parameter. DBMS_OUTPUT.PUT_LINE(get_sal(x)); DBMS_OUTPUT.PUT_LINE(get_sal(100+x)); LINE(get_sal(100)); Not in the options | Not in the options |