Database-Oracle [3i Infotech Placement]: Sample Questions 118 - 120 of 132

Glide to success with Doorsteptutor material for competitive exams : get questions, notes, tests, video lectures and more- for all subjects of your exam.

Question 118

Oracle

Question

MCQ▾
  1. Declare
  2. @fvarfloat :=null;
  3. svarnumber:=5
  4. begin
  5. goto ≪fproc
  6. if@fvarisnullbegin
  7. fproc
  8. svar:=svar+5&
  9. endif.
  10. End.

What will be the value of svar after the execution?

Choices

Choice (4)

a.

Error

b.

10

c.

5

d.

Question does not provide sufficient data or is vague

Answer

c.

Explanation

Program execution would lead to an end if without and if.

Question 119

Oracle

Question

MCQ▾

If two groups are not linked in the data model editor, what is the hierarchy between them?

Choices

Choice (4)

a.

There is no hierarchy between unlinked groups

b.

The group that is to the right ranks higher than the group that is to the left

c.

The group that is above or leftmost ranks higher than the group that is to right or below it

d.

Question does not provide sufficient data or is vague

Answer

c.

Explanation

The group that is above or leftmost ranks higher than the group that is to right or below it.

Question 120

Oracle

Question

MCQ▾

A Stored Procedure is a

Choices

Choice (4)

a.

Can be called from all client environments

b.

Sequence of SQL or PL/SQL statements to perform specific function

c.

Stored in compiled form in the database

d.

All a., b. and c. are correct

Answer

d.

Explanation

Define Store Procedure
  • A procedure is a named PL/SQL block, which performs one or more specific task.
  • A procedure has a header and body
  • Consists of the name and the parameters passed to the procedure.
  • The body declaration section, execution section and exception section form general PL/SQL block.
  • Used as building blocks for several different applications.

Advantages of stored procedure:

  • Maintainability:
    • Because scripts are in one location, easy to update and track dependencies based on schema.
  • Testing:
    • Can be tested independent of the application.
  • Isolation of business rules:
    • Having Stored Procedures in one location.
  • Speed:
    • Store procedures are cached on the server.
  • Security:
    • Limit direct access to tables via defined roles in the database.
    • Separating data and the code that accesses.

Developed by: