Filters
Question type

Study Flashcards

The ____________________ data dictionary view is also useful to identify what packages exist on the system.

Correct Answer

verifed

verified

What is meant by the term package body?

Correct Answer

verifed

verified

A package body is the program unit that ...

View Answer

CREATE OR REPLACE PACKAGE ordering_pkg IS Pv_total_num NUMBER(3,2) ; PROCEDURE order_total_pp (p_bsktid IN NUMBER, P_sub OUT NUMBER) ; FUNCTION ship_calc_pf (p_qty IN NUMBER) RETURN NUMBER; END; When creating a package body for the package specification above, which of the following statements is incorrect?


A) The package body must be created using the same name as the existing specification.
B) All code in the procedure and function header sections in the package body must match exactly to the declarations in the corresponding specification.
C) The package body cannot include declarations of variables, cursors, types, and program units not found in the corresponding specification.
D) Items declared in the body and not in the specification can be used only by other procedures and functions within this same package body.

E) B) and D)
F) A) and B)

Correct Answer

verifed

verified

A(n) ____________________ procedure is a procedure in a package that runs only once, when the package is initially invoked.

Correct Answer

verifed

verified

A package specification can contain declarations for procedures, functions, variables, exceptions, cursors, and types.

A) True
B) False

Correct Answer

verifed

verified

CREATE OR REPLACE PACKAGE metric_pkg IS cup_to_liter CONSTANT NUMBER := .24; Pint_to_liter CONSTANT NUMBER := .47; Qrt_to_liter CONSTANT NUMBER := .95; END; Which of the following statements about the code fragment above is correct?


A) The CONSTANT option allows the values of the variables to be modified.
B) There is no need to create a body for this package.
C) Program units are included in the package.
D) The package body must be created.

E) All of the above
F) B) and C)

Correct Answer

verifed

verified

The ____ packaged function purity level does not modify database tables.


A) RNDS
B) WNDS
C) WNPS
D) RNPS

E) A) and B)
F) B) and C)

Correct Answer

verifed

verified

If a cursor is declared in a package specification that referenced the PV_TOTAL_NUM package variable, the variable ____.


A) need not be declared
B) must be declared after the cursor
C) must be declared as private
D) must be declared before the cursor

E) None of the above
F) B) and D)

Correct Answer

verifed

verified

The DEL command can be used to remove the package specification and body. _________________________

A) True
B) False

Correct Answer

verifed

verified

The statement ____ would successfully declare a REF CURSOR data type.


A) CREATE testcur as REF CURSOR;
B) TYPE testcur IS ref cursor;
C) TYPE testcur ref_cursor;
D) testcur REF_CURSOR;

E) A) and B)
F) C) and D)

Correct Answer

verifed

verified

The pragma level defines what type of data structures the function reads or modifies.

A) True
B) False

Correct Answer

verifed

verified

When compiling objects that call packaged program units, which of the following statements is True?


A) Restriction violations are not discovered until runtime.
B) Only the program body is used for verification.
C) Because only the package body information is used, the PL/SQL compiler cannot determine if the restrictions on functions within SQL statements are being respected.
D) Restriction violations are discovered at compile time.

E) None of the above
F) All of the above

Correct Answer

verifed

verified

A

Package elements are considered public if they can be called only from other program units within the same package. _________________________

A) True
B) False

Correct Answer

verifed

verified

When the values of package element persist throughout a user session and, therefore, can be referenced in code within various parts of the application during a user session, the elements are considered to be global. _________________________

A) True
B) False

Correct Answer

verifed

verified

Define the term package, and explain why it is used.

Correct Answer

verifed

verified

A package is another type of PL/SQL construct that can house multiple program units and contain other constructs, such as variables and cursors. Using packages not only allows programmers to organize program units into related groups, but also enables the establishment of private program units, the sharing of variable values across program units, the overloading of program units, easier user privilege granting, and improved performance. Packages also lead to improved handling of dependencies.

Developers can use the PRAGMA RESTRICT_REFERENCES compiler instruction to indicate the purity level of the function in the package specification.

A) True
B) False

Correct Answer

verifed

verified

The term user scope is the range of visibility for a particular element or construct contained in a package. _________________________

A) True
B) False

Correct Answer

verifed

verified

False

The query to be used to populate a ____________________ data type can be determined at run time.

Correct Answer

verifed

verified

The AUTHID CURRENT_USER clause is used to override definer-rights behavior. _________________________

A) True
B) False

Correct Answer

verifed

verified

One advantage that packages provide is that constructs, such as variables, cursors, types, and exceptions, declared in the specification are ____________________.

Correct Answer

verifed

verified

Showing 1 - 20 of 68

Related Exams

Show Answer