PL SQL Objective Questions 2
When should an alias be used in a CURSOR FOR LOOP?
- Always
- Only when virtual columns are used
- Never
- When the number of tables are more than one
Ans : 2
What can a CURSOR FOR LOOP use?
- Explicit cursor only
- Implicit cursor only
- Explicit or Implicit cursors
- Cursor variables only
Ans : 1
For which of the following statements can a CURRENT OF clause be used?
- INSERT, DELETE or UPDATE
- DELETE or UPDATE
- SELECT or INSERT
- SELECT or UPDATE
Ans :2
How is the Loop index of a CURSOR FOR LOOP declared?
- It is explicitly declared as a %TYPE record variable of the type
- It is implicitly declared as a %TYPE record variable of the type
- It is explicitly declared as a %ROWTYPE record variable of the type
- 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?
- CURSOR cr_name IS SELECT column_names FROM tbl FOR UPDATE;
- CURSOR cr_name IS FOR UPDATE SELECT column_names FROM tbl ;
- CURSOR cr_name IS SELECT column_names FOR UPDATE from tbl;
- 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?
- %found
- %notfound
- %rowcount
- %rowtype
Ans :4
Which of these is not a similarity between an explicit cursor and cursor variable?
- The way cursor is closed
- The way data is fetched
- The value of cursor attributes
- The way cursor is opened
Ans : 4
Which of the following is incorrect about cursor variables?
- It can be associated with different queries at different times
- A value can be assigned to a cursor variable and it can be used in an expression
- Parameters can be passed to a cursor variable.
- Cursor variables can be used to reduce client-server network traffic
Ans :3
What is SYS_REFCURSOR?
- A user defined REF CURSOR that is weakly typed
- A predefined REF CURSOR that is weakly typed
- A predefined REF CURSOR that is strongly typed
- A user defined REF CURSOR that is strongly typed
Ans :2
Which of these have same attributes?
- Implicit and explicit cursors
- Implicit cursor, explicit cursor and cursor variables
- Explicit cursors and cursor variables
- 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?
- Integer is a subtype of Number
- List<Integer> is a subtype of List<Number>
- List<Integer> is not a subtype of List<Number>
- Number is a subtype of Object
Ans :2
Which of the following types of cursor variables has a RETURN clause?
- Strongly typed
- Weakly typed
- Both strongly and Weakly Typed
- There is no RETURN clause in any cursor variable
Ans :1
Which of the following statement for opening a cursor variable is correct?
- OPEN cursor_nameAs select_statement
- OPEN cursor_name
- OPEN cursor_name FOR select_statement
- OPEN cursor_name IS select_statement
Ans :3
How many attributes are there for a cursor variable?
- 2
- 1
- 4
- 3
Ans : 3
The command used to open a CURSOR FOR loop is
- Open
- Fetch
- Parse
- 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?
- It causes the cursor to close
- It causes the cursor to open
- It loads the current row values into variables
- It creates the variables to hold the current row values
Ans : 2
Which of the following is not a common cursor attribute?
- %IsOpen
- %IsNotOpen
- %Found
- %NotFound
Ans : 2
Which provide a way for select multiple rows of data from the database?
- PL/SQL Cursors
- PL/SQL Trigger
- PL/SQL Select
- PL/SQL Process
Ans : 1
Which enables your program to process the rows at a time?
- Tracker
- Cursor
- Accesser
- Trigger
Ans : 2
Which listed attribute is an invalid attribute of an Explicit cursor.
- %NOTFOUND
- %FOUND
- %ROWCOUNT
- 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.
- Cursor
- Trigger
- Package
- Exceptions
Ans : 1
How many types of cursors in oracle?
- 2
- 3
- 1
- 0
Ans : 1
Can you pass a parameter to a cursor?
- Yes
- No
- Depends upon
- Invalid option
Ans : 1
Read More PL/SQL Objective Questions and Answers