Oracle PL SQL Programming
This test consist of the questions related to PL/SQL programming concept and this test is useful for GATE /UGC/NET and also for academic students.
Questions
Which of the following is the incorrect statement about 'Unnamed System Exceptions' in PL/SQL?
- These exceptions are raised implicitly.
- These exceptions can be handled explicitly also.
- These are pre-defined exceptions and given a name in Oracle.
- EXCEPTION_INIT has associate a predefined Oracle error number to a programmer_defined exception name.
- The pragma EXCEPTION_INIT is declared in the declarative part of a PL/SQL block.
Which of the following is/are incorrect about 'raise_application_error' in PL/SQL?
- It defines the user-defined error message.
- The syntax for this procedure is raise_application_error(error_number, message).
- By using this procedure, all the uncommitted transactions within the PL/SQL block are rolled back automatically.
- RAISE_APPLICATION_ERROR raises an exception but does not handle it.
- Both (2) and (4)
Which of the following statements is/are incorrect about % ROWCOUNT function in PL/SQL cursor?
- It returns the invalid cursor error in case of cursor is not declared.
- It returns the number of rows fetched.
- An iteration gives the count of rows for the defined cursor.
- It returns TRUE if a successful fetch has been executed.
- If no row is returned, then this function returns an error.
What information does DBMS_UTILITY.FORMAT_ERROR_ function have in exception trapping functions?
- It returns the error number for the latest occurred exception in the PL/SQL block.
- It returns the error message associated with the later error number.
- It provides details about the error message.
- It provides details on the line containing the error.
- It retunes the error details about the DML statements.
Which of the following conditions is not responsible for invalid cursor error in PL/SQL?
- FETCH cursor before opening the cursor.
- CLOSE cursor before opening the cursor.
- FETCH cursor after closing the cursor.
- It is raised when a database call is issued without being connected to the database.
- None of the above
Which of the following statements is false regarding user defined exception in PL/SQL?
- An user-defined exception must be declared and then raised explicitly.
- An user defined exception can be created using a RAISE statement.
- The procedure DBMS_STANDARD. RAISE_APPLICATION_ERROR can also throw an user defined exception.
- RAISE statements can raise predefined exceptions and also user defined exceptions.
- User-defined exceptions are declared in the exception section with their types as exceptions.
Which of the following statements is incorrect regarding '%FOUND' cursor attribute in PL/SQL?
- Returns INVALID_CURSOR if cursor is declared, but not open or if cursor has been closed.
- Returns NULL if cursor is open, but fetch has not been executed.
- Returns TRUE if a successful fetch has been executed.
- Returns FALSE if no row was returned.
- Returns the number of rows fetched.
Which of the following predefined exceptions raises out of memory error in PL/SQL?
- PROGRAM_ERROR
- NO_DATA_FOUND
- SELF_IS_NULL
- ACCESS_INTO_NULL
- None of the above
Which of the following statements is incorrect regarding the predefined exceptions in PL/SQL?
- These exceptions are internally defined exceptions with a name.
- These exceptions are raised by the system.
- The storage error is a predefined exception.
- Out of memory is a predefined exception.
- ZERO_DIVIDE is an example of predefined exception.
Which of the following statements is/are correct about 'WRITE clause' in PL/SQL COMMIT statement?
- It is used to specify the priority that the redo information for the committed transaction is to be written to the redo log.
- It is used to force the commit of a transaction that may be corrupt or in doubt.
- It is used to specify a comment to be associated with current transaction.
- This clause is optional.
- Both (1) and (4)
Which of the following statements is/are correct about 'IN OUT Parameter' in PL/SQL procedure?
- These types of parameters are used to send values and get values from stored procedures.
- This parameter is used if the value of the parameter will be changed in the procedure.
- This is a write-only parameter, i.e. one cannot pass values to OUT paramters while executing the stored procedure.
- This parameters is used to send only the OUTPUT from a procedure or a function.
- Both (1) and (2)
What is 'ISOLATION LEVEL SERIALIZE' parameter in SET TRANSACTION statement in PL/SQL?
- It is used to check the resource to be updated by multiple transactions.
- If a transaction requires row locks held by another transaction, the transaction will wait until the row locks are released.
- It assigns the transaction to a rollback segment identified by 'segment_name'.
- It assigns a name to the transaction identified by 'transaction_name'.
- Both (1) and (3)
What is the significance of '[OF col_name]' clause in PL/SQL trigger?
- This clause is used with update triggers.
- It creates a trigger with the given name or overwrites an existing trigger with the same name.
- This clause is used to reference the old and new values of the data being changed.
- This clause is used to determine whether a trigger must fire when each row gets affected.
- This clause is valid only for row level triggers.
Which of the following statements is/are incorrect about 'SAVEPOINT' clause in Rollback statement in PL/SQL?
- It is used to undo all the changes for the current session.
- It is used to force the rollback of a transaction that may be corrupt or in doubt.
- ROLLBACK TO SAVEPOINT savepoint 1 is the syntax for this clause.
- ROLLBACK WORK TO SAVEPOINT savepoint 1 is the syntax for this clause.
- Both (2) and (3)
What is 'ISOLATION LEVEL READ COMMITTED' parameter in SET TRANSACTION statement in PL/SQL?
- If a transaction attempts to update a resource that has been updated by another transaction and uncommitted, the transaction will fail.
- It is used to release the lock for the multiple transactions allocated for the same resource.
- It assigns a name to the transaction identified by 'transaction_name'.
- It assigns a name to the transaction identified by 'transaction_name'.
- None of the above