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.

15 Questions Published

Questions

Question 1 Multiple Choice (Single Answer)

Which of the following is the incorrect statement about 'Unnamed System Exceptions' in PL/SQL?

  1. These exceptions are raised implicitly.
  2. These exceptions can be handled explicitly also.
  3. These are pre-defined exceptions and given a name in Oracle.
  4. EXCEPTION_INIT has associate a predefined Oracle error number to a programmer_defined exception name.
  5. The pragma EXCEPTION_INIT is declared in the declarative part of a PL/SQL block.
Question 2 Multiple Choice (Single Answer)

Which of the following is/are incorrect about 'raise_application_error' in PL/SQL?

  1. It defines the user-defined error message.
  2. The syntax for this procedure is raise_application_error(error_number, message).
  3. By using this procedure, all the uncommitted transactions within the PL/SQL block are rolled back automatically.
  4. RAISE_APPLICATION_ERROR raises an exception but does not handle it.
  5. Both (2) and (4)
Question 3 Multiple Choice (Single Answer)

Which of the following statements is/are incorrect about % ROWCOUNT function in PL/SQL cursor?

  1. It returns the invalid cursor error in case of cursor is not declared.
  2. It returns the number of rows fetched.
  3. An iteration gives the count of rows for the defined cursor.
  4. It returns TRUE if a successful fetch has been executed.
  5. If no row is returned, then this function returns an error.
Question 4 Multiple Choice (Single Answer)

What information does DBMS_UTILITY.FORMAT_ERROR_ function have in exception trapping functions?

  1. It returns the error number for the latest occurred exception in the PL/SQL block.
  2. It returns the error message associated with the later error number.
  3. It provides details about the error message.
  4. It provides details on the line containing the error.
  5. It retunes the error details about the DML statements.
Question 5 Multiple Choice (Single Answer)

Which of the following conditions is not responsible for invalid cursor error in PL/SQL?

  1. FETCH cursor before opening the cursor.
  2. CLOSE cursor before opening the cursor.
  3. FETCH cursor after closing the cursor.
  4. It is raised when a database call is issued without being connected to the database.
  5. None of the above
Question 6 Multiple Choice (Single Answer)

Which of the following statements is false regarding user defined exception in PL/SQL?

  1. An user-defined exception must be declared and then raised explicitly.
  2. An user defined exception can be created using a RAISE statement.
  3. The procedure DBMS_STANDARD. RAISE_APPLICATION_ERROR can also throw an user defined exception.
  4. RAISE statements can raise predefined exceptions and also user defined exceptions.
  5. User-defined exceptions are declared in the exception section with their types as exceptions.
Question 7 Multiple Choice (Single Answer)

Which of the following statements is incorrect regarding '%FOUND' cursor attribute in PL/SQL?

  1. Returns INVALID_CURSOR if cursor is declared, but not open or if cursor has been closed.
  2. Returns NULL if cursor is open, but fetch has not been executed.
  3. Returns TRUE if a successful fetch has been executed.
  4. Returns FALSE if no row was returned.
  5. Returns the number of rows fetched.
Question 8 Multiple Choice (Single Answer)

Which of the following predefined exceptions raises out of memory error in PL/SQL?

  1. PROGRAM_ERROR
  2. NO_DATA_FOUND
  3. SELF_IS_NULL
  4. ACCESS_INTO_NULL
  5. None of the above
Question 9 Multiple Choice (Single Answer)

Which of the following statements is incorrect regarding the predefined exceptions in PL/SQL?

  1. These exceptions are internally defined exceptions with a name.
  2. These exceptions are raised by the system.
  3. The storage error is a predefined exception.
  4. Out of memory is a predefined exception.
  5. ZERO_DIVIDE is an example of predefined exception.
Question 10 Multiple Choice (Single Answer)

Which of the following statements is/are correct about 'WRITE clause' in PL/SQL COMMIT statement?

  1. It is used to specify the priority that the redo information for the committed transaction is to be written to the redo log.
  2. It is used to force the commit of a transaction that may be corrupt or in doubt.
  3. It is used to specify a comment to be associated with current transaction.
  4. This clause is optional.
  5. Both (1) and (4)
Question 11 Multiple Choice (Single Answer)

Which of the following statements is/are correct about 'IN OUT Parameter' in PL/SQL procedure?

  1. These types of parameters are used to send values and get values from stored procedures.
  2. This parameter is used if the value of the parameter will be changed in the procedure.
  3. This is a write-only parameter, i.e. one cannot pass values to OUT paramters while executing the stored procedure.
  4. This parameters is used to send only the OUTPUT from a procedure or a function.
  5. Both (1) and (2)
Question 12 Multiple Choice (Single Answer)

What is 'ISOLATION LEVEL SERIALIZE' parameter in SET TRANSACTION statement in PL/SQL?

  1. It is used to check the resource to be updated by multiple transactions.
  2. If a transaction requires row locks held by another transaction, the transaction will wait until the row locks are released.
  3. It assigns the transaction to a rollback segment identified by 'segment_name'.
  4. It assigns a name to the transaction identified by 'transaction_name'.
  5. Both (1) and (3)
Question 13 Multiple Choice (Single Answer)

What is the significance of '[OF col_name]' clause in PL/SQL trigger?

  1. This clause is used with update triggers.
  2. It creates a trigger with the given name or overwrites an existing trigger with the same name.
  3. This clause is used to reference the old and new values of the data being changed.
  4. This clause is used to determine whether a trigger must fire when each row gets affected.
  5. This clause is valid only for row level triggers.
Question 14 Multiple Choice (Single Answer)

Which of the following statements is/are incorrect about 'SAVEPOINT' clause in Rollback statement in PL/SQL?

  1. It is used to undo all the changes for the current session.
  2. It is used to force the rollback of a transaction that may be corrupt or in doubt.
  3. ROLLBACK TO SAVEPOINT savepoint 1 is the syntax for this clause.
  4. ROLLBACK WORK TO SAVEPOINT savepoint 1 is the syntax for this clause.
  5. Both (2) and (3)
Question 15 Multiple Choice (Single Answer)

What is 'ISOLATION LEVEL READ COMMITTED' parameter in SET TRANSACTION statement in PL/SQL?

  1. If a transaction attempts to update a resource that has been updated by another transaction and uncommitted, the transaction will fail.
  2. It is used to release the lock for the multiple transactions allocated for the same resource.
  3. It assigns a name to the transaction identified by 'transaction_name'.
  4. It assigns a name to the transaction identified by 'transaction_name'.
  5. None of the above