PCS Infotech Placement: Sample Questions 7 - 8 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 7

Question

MCQ▾

Can PL/SQL reserved words be used in SQL?

Choices

Choice (4)

a.

No

b.

Yes

c.

All of the above

d.

None of the above

Answer

b.

Explanation

  • Yes, PL/SQL reserved words can be used with quotation.
  • The $ RESERVED_WORDS data dictionary view provides additional information on each reserved word.
  • Words reserved by PL/SQL are classified as keywords or reserved words.
  • Never to be used as identifiers.
  • Keywords can be used as identifiers but not recommended.

Question 8

Edit

Describe in Detail

Essay▾

Which are the mandatory parts of PL/SQL procedure?

Explanation

  • The PL/SQL stored procedure is a PL/SQL block with performs one or more specific task.
  • The procedure contains a header and a body

Header

  • The section before IS keyword is called procedure header.
  • Elements of procedure՚s header are:
  • Schema:
    • Optional name of the schema to which the procedure belongs.
    • Default is the current user.
    • We can specify a different user- the current user must have privileges to create a procedure.
  • Name:
    • Convention dictates that procedure name starts with a verb.
  • Parameters:
    • Optional list of parameters.
    • PL/SQL function parameters have different modes- IN, OUT and IN OUT.
  • AUTHID:
    • Determines execution privileges- privileges of the procedure owner or the privileges of current user specified by CURRENT_USER.

Body

  • Similar syntax as an anonymous block- consist of the declaration, execution, and exception.
  • Declaration and exception sections are optional.
  • At least one executable statement must be in the execution section.
  • PL/SQL procedure can have a RETURN statement, which does not take any expression or constant.

Developed by: