PL/SQL Packages - PL/SQL (MCQ) questions and answers

Here, you can read PL/SQL Packages multiple choice questions and answers with explanation.

1)   A package cursor is a cursor which you declare in the package specification without an SQL statement.
- Published on 09 Jul 15

a. Yes
b. No
Answer  Explanation 

ANSWER: Yes

Explanation:
No explanation is available for this question!


2)   Which internal exception is raised when a program references a nested table or varray element using an index number larger than the number of elements in the collection.
- Published on 09 Jul 15

a. NO_DATA_FOUND
b. COLLECTION_IS_NULL
c. SUBSCRIPT_OUTSIDE_LIMIT
d. SUBSCRIPT_BEYOND_COUNT
Answer  Explanation 

ANSWER: SUBSCRIPT_BEYOND_COUNT

Explanation:
The SUBSCRIPT_BEYOND_COUNT error is where the in-limit of a subscript was greater than that of the count of a varray or was too large for a nested table.


3)   Which of the following are the advantages of PL/SQL Packages?
- Published on 08 Jul 15

a. Modularity
b. Easier Application Design
c. Information Hiding
d. Added Functionality,Better Performance
e. All mentioned above
Answer  Explanation 

ANSWER: All mentioned above

Explanation:
No explanation is available for this question!


4)   Any subprogram not in the package specification but coded in the package body is called a ___________ .
- Published on 08 Jul 15

a. Public object
b. Private object
c. Both A & B
d. None of the above
Answer  Explanation 

ANSWER: Private object

Explanation:
Private objects are the one which are not visible to the applications outside the package.


5)   The constructs of a procedure, function or a package are ________ .
- Published on 08 Jul 15

a. Variables and Constants
b. Cursors
c. Exceptions
d. All mentioned above
Answer  Explanation 

ANSWER: All mentioned above

Explanation:
No explanation is available for this question!


6)   Which collection method Returns the index number that precedes index n in a collection?
- Published on 07 Jul 15

a. PRIOR(n)
b. LAST
c. LIMIT
d. COUNT
Answer  Explanation 

ANSWER: PRIOR(n)

Explanation:
The PRIOR(n) return the index number that precedes index n in PL/SQL table. If the value n has no predecessor then it returns null. the PRIOR and NEXT do not wrap from one end to the other.


7)   A package will have which of these mandatory parts?
- Published on 07 Jul 15

a. Package specification
b. Package body or definition
c. Both A & B
d. None of the above
Answer  Explanation 

ANSWER: Both A & B

Explanation:
A package has two mandatory parts:

1. Package Specification - This is the interface to the package. It declares the types,variables,constants,exceptions,cursors and the subprograms. It contains all information about the content of the package.
2. Package Body - It consists of all the codes for the methods declared in the package specification.


8)   You can pass parameters to procedures or functions in a package.
- Published on 19 Oct 15

a. True
b. False
Answer  Explanation 

ANSWER: True

Explanation:
The parameters can be passed as default also to the procedures and the functions.


9)   Which package lets PL/SQL programs read and write operating system (OS) text files?
- Published on 19 Oct 15

a. UTL_HTTP
b. UTL_FILE
c. UTL_SMTP
d. None of the above
Answer  Explanation 

ANSWER: UTL_FILE

Explanation:
UTL_FILE helps the PL/SQL programs read and write operating system text files. It provides a restricted version of the operating system stream file I/O.


10)   Which of the following is not a schema object?
- Published on 19 Oct 15

a. Packages
b. Indexes
c. Public Synonyms
d. Triggers
Answer  Explanation 

ANSWER: Public Synonyms

Explanation:
A alternative name for a table,view etc is known as a synonym. A synonym which is accessible to all the users is known as a public synonym. Hence, a public synonym is not a schema object.


1 2