Database [PCS Infotech Placement]: Sample Questions 17 - 18 of 25

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 17

Database
Edit

Statement

True-False▾

A package without body is possible

Answer

TRUE

Explanation

Advantages of Using Packages
  • Package without body declares global cursor and constant that can use by other function, procedures or packages.
  • Procedures in body are private subprograms accessible only by subprograms inside the package not from outside.
  • If public item includes cursors or subprograms, then the package must have a body.
  • The body defines queries for public cursor and code for public subprogram.

Use of Packages

  • Modularity
  • Easier application design
  • Hidden implementation details
  • Added functionality
  • Better Performance
  • Easier to Grant Roles

Question 18

Database
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.

Developed by: