Packages Flashcards

1
Q

What are packages?

A

Schema objects that groups logically related PL/SQL types, variables, and subprograms

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What are the two components of a package?

A
  • Package specification

- Package body or definition

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What does the package specification do?

A

DECLARES the types, variables, constants, exceptions, cursors, and subprograms that can be referenced from outside the package

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

All objects placed in the specification are called ____

A

Public objects

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Any subprogram not in the package specification but coded in the package body are called ___

A

Private objects

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What is the syntax for the package specification?

A

CREATE OR REPLACE PACKAGE name IS
–Declaration of global variables, types, cursors
–Headers of public procedures & functions public (implicit)
END name;

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

What is the package body?

A

Has the codes for various methods declared in the package specification and other private declarations

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

What is the syntax for the package body?

A

CREATE OR REPLACE PACKAGE BODY name IS
#Declare private variables, types, cursors
#Code public and private functions and procedures
END name;

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

Where is package code loaded on first call?

A

Memory

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

What permissions does the package have run you run the code?

A

The same of the owner of the package

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

Can you compile the specification and body separately?

A

Yes

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

What is the syntax for accessing package elements?

A

package_name.element_name;

How well did you know this?
1
Not at all
2
3
4
5
Perfectly