PL SQL Objective Questions 2

PL SQL Objective Questions 2

PL-SQL-Objective-Questions-NareshIT

When should an alias be used in a CURSOR FOR LOOP?

  1. Always
  2. Only when virtual columns are used
  3. Never
  4. When the number of tables are more than one

Ans :  2


What can a CURSOR FOR LOOP use?

  1. Explicit cursor only
  2. Implicit cursor only
  3. Explicit or Implicit cursors
  4. Cursor variables only

Ans : 1


For which of the following statements can a CURRENT OF clause be used?

  1. INSERT, DELETE or UPDATE
  2. DELETE or UPDATE
  3. SELECT or INSERT
  4. SELECT or UPDATE

Ans :2


How is the Loop index of a CURSOR FOR LOOP declared?

  1. It is explicitly declared as a %TYPE record variable of the type
  2. It is implicitly declared as a %TYPE record variable of the type
  3. It is explicitly declared as a %ROWTYPE record variable of the type
  4. It is implicitly declared as a %ROWTYPE record variable of the

Ans :4


What is the correct syntax of using FOR UPDATE clause in CURSORS?

  1. CURSOR cr_name IS SELECT column_names FROM tbl FOR UPDATE;
  2. CURSOR cr_name IS FOR UPDATE SELECT column_names FROM tbl ;
  3. CURSOR cr_name IS SELECT column_names FOR UPDATE from tbl;
  4. CURSOR cr_name IS SELECT FOR UPDATE column_names FROM tbl;

Ans :1


Attend Free Demo and Learn   SQL SERVER ONLINE TRAINING   by Real-Time Expert


Which of the following is not a  implicit cursor attributes?

  1. %found
  2. %notfound
  3. %rowcount
  4. %rowtype

Ans :4


Which of these is not a similarity between an explicit cursor and cursor variable?

  1. The way cursor is closed
  2. The way data is fetched
  3. The value of cursor attributes
  4. The way cursor is opened

Ans : 4


Which of the following is incorrect about cursor variables?

  1. It can be associated with different queries at different times
  2. A value can be assigned to a cursor variable and it can be used in an expression
  3. Parameters can be passed to a cursor variable.
  4. Cursor variables can be used to reduce client-server network traffic

Ans :3


What is SYS_REFCURSOR?

  1. A user defined REF CURSOR that is weakly typed
  2. A predefined REF CURSOR that is weakly typed
  3. A predefined REF CURSOR that is strongly typed
  4. A user defined REF CURSOR that is strongly typed

Ans :2


Which of these have same attributes?

  1. Implicit and explicit cursors
  2. Implicit cursor, explicit cursor and cursor variables
  3. Explicit cursors and cursor variables
  4. Implicit cursors and cursor variable

Ans :2


Attend Free Demo and Learn   SQL SERVER ONLINE TRAINING   by Real-Time Expert


Which of the following statements is FALSE?

  1. Integer is a subtype of Number
  2. List<Integer> is a subtype of List<Number>
  3. List<Integer> is not a subtype of List<Number>
  4. Number is a subtype of Object

Ans :2


Which of the following types of cursor variables has a RETURN clause?

  1. Strongly typed
  2. Weakly typed
  3. Both strongly and Weakly Typed
  4. There is no RETURN clause in any cursor variable

Ans :1


Which of the following statement for opening a cursor variable is correct?

  1. OPEN cursor_nameAs select_statement
  2. OPEN cursor_name
  3. OPEN cursor_name FOR select_statement
  4. OPEN cursor_name IS select_statement

Ans :3


How many attributes are there for a cursor variable?

  1. 2
  2. 1
  3. 4
  4. 3

Ans : 3


The command used to open a CURSOR FOR loop is

  1. Open
  2. Fetch
  3. Parse
  4. None, cursor for loop handle cursor opening implicitly.

Ans :D


Attend Free Demo and Learn   SQL SERVER ONLINE TRAINING   by Real-Time Expert


What happens when rows are found using a FETCH STATEMENT?

  1. It causes the cursor to close
  2. It causes the cursor to open
  3. It loads the current row values into variables
  4. It creates the variables to hold the current row values

Ans : 2


Which of the following is not a common cursor attribute?

  1. %IsOpen
  2. %IsNotOpen
  3. %Found
  4. %NotFound

Ans : 2


Which provide a way for select multiple rows of data from the database?

  1. PL/SQL Cursors
  2. PL/SQL Trigger
  3. PL/SQL Select
  4. PL/SQL Process

Ans : 1


Which enables your program to process the rows at a time?

  1. Tracker
  2. Cursor
  3. Accesser
  4. Trigger

Ans : 2


Which listed attribute is an invalid attribute of an Explicit cursor.

  1. %NOTFOUND
  2. %FOUND
  3. %ROWCOUNT
  4. None of the above

Ans : 4


Attend Free Demo and Learn   SQL SERVER ONLINE TRAINING   by Real-Time Expert


A buffer used to results of the recent query.

  1. Cursor
  2. Trigger
  3. Package
  4. Exceptions

Ans : 1


How many types of cursors in oracle?

  1. 2
  2. 3
  3. 1
  4. 0

Ans : 1


Can you pass a parameter to a cursor?

  1. Yes
  2. No
  3. Depends upon
  4. Invalid option

Ans : 1


Read More PL/SQL Objective Questions and Answers

Click Here
Click Here
Click Here
PL/SQL Objectives 1
PL/SQL Objectives 2
PL/SQL Objectives 3
PL/SQL Objectives 4
PL/SQL Objectives 5
PL/SQL Objectives 6
PL/SQL Objectives 7
PL/SQL Objectives 8
PL/SQL Objectives 9
PL/SQL Objectives 10
PL/SQL Objectives 11
PL/SQL Objectives 12
PL/SQL Objectives 13
PL/SQL Objectives 14
PL/SQL Objectives 15

Share this post