Database-MySQL [PCS Infotech Placement]: Sample Questions 16 - 17 of 23

Get unlimited access to the best preparation resource for competitive exams : get questions, notes, tests, video lectures and more- for all subjects of your exam.

Question 16

Edit

Statement

True-False▾

Subprograms have equal scope as variables

Answer

FALSE

Explanation

Define What Are PL/SQL Subprogram?
  • Subprogram is a named PL/SQL block that can invoked.
  • Their values can differ for each invocation.
  • Subprogram is either a procedure or a function.
    • Procedure performs an action
    • Functions compute and return a value.

Use of Subprogram

  • Modularity:
    • Manageable, well-define modules.
  • Easier Application design:
    • Details of the subprogram can be written in parallel to main program.
  • Maintainability:
    • Change the implementation details of a subprogram without its invokers.
  • Packageability:
    • Subprograms grouped into package.
  • Reusability:
    • Number of applications in many different environments can use the same package subprogram or stored subprogram.
  • Better Performance:
    • Subprogram is compiled and stored in executable form.
    • Division of work reduces network traffic and improves response times.

Question 17

Edit

Statement

True-False▾

Can a cursor be closed two times?

Answer

FALSE

Explanation

Define Close Cursor

Close Command

  • Closes an open cursor by releasing the current result set cursor lock held on the rows.
  • Data structures available for reopening, fetching and positing not available until cursor is reopened.
  • After closing explicit cursor, we can reopen it with the OPEN statement.
  • Closing a closed cursor would throw and error. Syntax of close cursor:
  • CLOSE CURSOR@dbcur

Developed by: