Oracle PL/SQL Programming

This test contains the P/L SQL basic programming questions, which are useful for CS and GATE aspirants.

15 Questions Published

Questions

Question 1 Multiple Choice (Single Answer)

Which of the following DBMS_OUTPUT subprograms retrieves an array of lines from the buffer?

  1. DBMS_OUTPUT.GET_LINE (line OUT VARCHAR2, status OUT INTEGER);
  2. DBMS_OUTPUT.GET_LINES (lines OUT CHARARR, numlines IN OUT INTEGER);
  3. DBMS_OUTPUT.PUT(item IN VARCHAR2);
  4. DBMS_OUTPUT.PUT_LINE(item IN VARCHAR2);
  5. DBMS_OUTPUT.DISABLE;
Question 2 Multiple Choice (Single Answer)

Which of the following events performs the ROLLBACK automatically in a PL/SQL transaction?

  1. A CREATE TABLE statement is issued
  2. A COMMIT or a ROLLBACK statement is issued
  3. A DCL statement, such as a GRANT statement is issued
  4. A DML statement fails
  5. An UPDATE statement is issued
Question 3 Multiple Choice (Single Answer)

What is the necessary condition for the Automatic Transaction Control in Oracle PL/SQL?

  1. The DML commands will be executed automatically by using this control.
  2. SET AUTOCOMMIT; is used to create AUTOCOMMIT environment variable.
  3. To split a long transaction into smaller units by setting some check points.
  4. It is used to manage the changes in the database.
  5. It is used to make the transaction safe.
Question 4 Multiple Choice (Single Answer)

Which of the following scenarios is not possible for User-defined Exception in P/L SQL?

  1. This exception must be raised explicitly.
  2. DBMS_STANDARD.RAISE_APPLICATION_ERROR procedure is used to raise this exception.
  3. This exception cannot be raised automatically when a program violates database rules or exceeds system-dependent limits.
  4. This exception caused the memory problems in the database.
  5. These exceptions are created according to user's requirement.
Question 5 Multiple Choice (Single Answer)

What is the necessary condition to execute a Standalone Procedure?

  1. By using the EXECUTE keyword, one can execute these procedures.
  2. By calling the method of the procedure from a PL/SQL block.
  3. By providing external command.
  4. By triggering the procedure.
  5. By synchronising the procedure.
Question 6 Multiple Choice (Single Answer)

Which of the following is incorrect about Stored Procedure in P/L SQL?

  1. It is a procedure to manage one or more tasks at a time.
  2. EXECUTE [or EXEC] procedure_name; can be used to execute the procedure.
  3. procedure_name; can be used to execute the procedure.
  4. One can pass parameters to procedures in three ways.
  5. The header consists of the name of the procedure and the parameters declaration section of the procedure.
Question 7 Multiple Choice (Single Answer)

Which of the following is the incorrect statement about the subprogram of PL/SQL block structure?

  1. Declarative part is optional part.
  2. Executable part is mandatory part.
  3. Exception-handling part is mandatory.
  4. The structure of a function is like that of a procedure.
  5. The procedures are made for these subprograms.
Question 8 Multiple Choice (Single Answer)

A declared cursor variable is not responsible for _______ in Oracle P/L SQL.

  1. REF CURSOR type stores the RECORD type of cursor variables.
  2. The compiler does not allow the weak type of cursor variables for queries.
  3. Strong REF CURSOR types are less error-prone than weak types but less flexible.
  4. The compiler allows only the weak types cursor variables for queries.
  5. The compiler provides the specification of all the variables.
Question 9 Multiple Choice (Single Answer)

Which of the following is called the security technique(s) while Committing Transactions in Oracle P/L SQL?

  1. It makes the changes permanent and affects the savepoints.
  2. The changes are not final.
  3. The changes are not visible to other users of the database instance.
  4. The newest Database Express Edition issues an implicit COMMIT statement before and after any data definition language (DDL) statement.
  5. The data restoration process will be at one point.
Question 10 Multiple Choice (Single Answer)

Which of the following is correct about IN OUT parameter in P/L SQL?

  1. This parameter does not return an updated value each time for the subprogram.
  2. This parameter returns a value to the calling program.
  3. It can be assigned a value and its value can be read.
  4. The actual parameter corresponding to an IN OUT formal parameter can be a constant.
  5. The parameter values cannot be changed.
Question 11 Multiple Choice (Single Answer)

Which of the following is the incorrect statement about the P/L SQL package in the database?

  1. A package in a PL/SQL unit is a combination of related programs.
  2. Packages allow you to hide implementation details from client programs.
  3. It does not allow client programs to access the database only by invoking PL/SQL subprograms.
  4. The package subprograms must be qualified with package names when invoked from outside the package.
  5. The package subprograms are arranged in a well defined module for each user.
Question 12 Multiple Choice (Single Answer)

Identify the action that makes the transaction safe in Rolling Back Transactions in Oracle P/L SQL?

  1. Ends the transaction
  2. Reverses all of its changes
  3. Erases all of its savepoints
  4. Releases any transaction locks
  5. Undo the changes
Question 13 Multiple Choice (Single Answer)

Which of the following assumptions that the DBA can apply during changing process, triggers in Oracle P/L SQL?

  1. In order to change a trigger, use either the SQL Developer tool Edit or the DDL statement.
  2. The triggers state cannot be changed for the list of schema object types.
  3. Triggers cannot be changed in the list of triggers.
  4. Trigger cannot be used for managing the database operations in a frequent manner.
  5. Triggers can be used for data synchronisation.
Question 14 Multiple Choice (Single Answer)

Identify the correct statement about Triggers in Oracle P/L SQL?

  1. A system trigger cannot be defined on a schema or the database.
  2. It is fired for each event associated with the owner of the schema (the current user).
  3. It is fired before the triggering event executes.
  4. It is fired after each row that the event affects.
  5. Triggers are fired when storage of data is performed.
Question 15 Multiple Choice (Single Answer)

Which of the following is correct about SUBSCRIPT_BEYOND_COUNT exception in Oracle P/L SQL?

  1. When subscript exceeds the number of elements in a collection.
  2. When a subscript is outside the allowed range.
  3. When a subscript is null or not convertible to the key type.
  4. When the user tries to operate on an atomically null collection.
  5. When the user tries to check the authenticated value for the particular type.