PL/SQL Chapter 5: Procedures

Réussis tes devoirs et examens dès maintenant avec Quizwiz!

A subprogram is created in the ____________________ section of the procedure block.

DECLARE

____________________ is the process of identifying and removing errors from within program code.

Debugging

An application trigger performs a task automatically when a DML action occurs on the table with which it is associated.

FALSE

Exception handling is the process of identifying and removing errors from within program code.

FALSE

Exception handling refers to the logical group of DML actions that is affected by a transaction control statement.

FALSE

Stored procedures are saved in an Oracle11g application or library on the client-side.

FALSE

The special syntax of =>> is used to accomplish named association.

FALSE

The term server-side refers to code that resides on the client machine.

FALSE

Three choices exist for parameter mode: INTO, OUT OF, and IN OUT.

FALSE

The special syntax of := is used to accomplish named association.

FALSE =>

The EXIT command can be used to remove procedures.

FALSE DROP

The values from an application that pass into parameters are called formal parameters.

FALSE actual parameters

The parameters in the procedure declaration of an application are called actual parameters.

FALSE formal parameters

In a(n) positional method, you associate a value to each parameter by name in the invoke statement.

FALSE named association

The term autonomous transaction refers to additional instructions for the PL/SQL compiler to use during program unit compilation.

FALSE pragma

Stored procedures and functions are saved in an Oracle11g application or library on the client-side.

FALSE Application procedures

A(n) database trigger performs tasks automatically when a particular application event occurs such as when a user clicks a button on the screen.

FALSE application trigger

A(n) application trigger performs tasks automatically when a DML action occurs on the table with which it is associated.

FALSE database trigger

If no mode is indicated in a parameter, the default value of ____________________ is applied.

IN

The ____________________ combined mode can achieve the passing of a value both into and out of a procedure with a single parameter.

IN OUT

____________________ indicate which way the value provided for the parameter flows: into the procedure, out of the procedure, or both.

Modes

With a(n) ____________________ only parameter, the parameter is empty when the procedure is invoked and a value is assigned to the parameter during the execution of the procedure and returned upon completion.

OUT

A PL/SQL block created and named is a named program unit or subprogram.

TRUE

A PL/SQL block that is created and named is known as a(n) named program unit.

TRUE

A program unit that is defined within another program unit is called a subprogram.

TRUE

A(n) procedure is used to accomplish one or more tasks, return none or many values, and can be used only in PL/SQL statements.

TRUE

Debugging is the process of identifying and removing errors from within program code.

TRUE

Only the program unit in which a subprogram is declared can use that subprogram.

TRUE

Program units are made flexible by using parameters, which are mechanisms to send values into and out of the program unit.

TRUE

The reuse of code is an important contributor to programming efficiency.

TRUE

The term pragma refers to additional instructions for the PL/SQL compiler to use during program unit compilation.

TRUE

The term program unit implies that we typically create blocks of code to perform specific tasks that may be needed within a number of applications.

TRUE

The values from the application that pass into parameters are called actual parameters; the parameters in the procedure declaration are called formal parameters.

TRUE

When invoking a procedure list, the values are listed in the order in which the parameters are declared in the procedure.

TRUE

____________________ refers to the logical group of DML actions that is affected by a transaction control statement.

Transaction scope

The ____ mode type is considered constant because it cannot be changed within the procedure. a. IN b. OUT c. INOUT d. IN OUT

a. IN

Which of the following statements is true? a. If an exception is raised in procedure B that has been called from procedure A, the control initially moves to the exception handler section of procedure B. b. If an exception is raised in procedure B that has been called from procedure A, the control initially moves to the BEGIN section of procedure B. c. If an exception is raised in procedure B that has been called from procedure A, the control initially moves to the exception handler section of procedure A. d. If an exception is raised in procedure B that has been called from procedure A, the control initially moves to the header section of procedure B.

a. If an exception is raised in procedure B that has been called from procedure A, the control initially moves to the exception handler section of procedure B.

____ a program unit or PL/SQL block of code allows the storage and reuse of the code. a. Naming b. Processing c. Creating d. Debugging

a. Naming

____ are mechanisms used to send values into and out of a program unit. a. Parameters b. Procedures c. Database triggers d. Packages

a. Parameters

____ is an example of a function. a. ROUND b. IN c. OUT d. IN OUT

a. ROUND

The term ____ refers to program code that resides on the user machine. a. client-side b. client/server c. two-tier d. server-side

a. client-side

The RAISE_APPLICATION_ERROR built-in function is provided by Oracle to ____. a. create error messages b. display error messages c. track error messages d. display functions

a. create error messages

The ____ command can be used to list details about the structure of a procedure, such as information regarding the parameters. a. UPDATE b. DESCRIBE c. TYPE d. %TYPE

b. DESCRIBE

The ____ command can be used to remove procedures. a. DEL b. DROP c. DELETE d. REMOVE

b. DROP

A parameter with a(n) ____ only mode can receive a value, but this value cannot be changed in the procedure. a. IN OUT b. IN c. OUT d. INOUT

b. IN

If values are calculated or retrieved from the database within the procedure, ____ parameters are used to return these values to the calling environment. a. IN b. OUT c. IN OUT d. INOUT

b. OUT

____ is a compiler directive. a. Autonomous b. Pragma c. Subprogram d. EXCEPTION

b. Pragma

____ can accept and return none, one, or many parameters. a. Triggers b. Procedures c. Packages d. Programs

b. Procedures

A(n) ____ performs tasks automatically when a particular application event occurs, such as when the user clicks a button on the screen. a. package b. application trigger c. stored procedure d. database trigger

b. application trigger

A(n) ____ must be assigned one of three available modes: IN, OUT, IN OUT. a. function b. parameter c. package d. procedure

b. parameter

One important item that needs to be considered when creating stored procedures is to make them flexible so that they can be ____. a. executed b. reused c. packaged d. triggered

b. reused

The variable name ____ conforms to Oracle11g naming standards. a. $quantity b. ship_date c. :p_ship d. _ship_date

b. ship_date

____ is an acceptable error number for the RAISE_APPLICATION_ERROR function. a. -18,000 b. -19,000 c. -20,002 d. -21,000

c. -20,002

The error message argument of the RAISE_APPLICATION_ERROR function can accept up to ____ characters. a. 300 b. 450 c. 512 d. 600

c. 512

____ no longer exist after being executed. a. Program units b. Exception handlers c. Anonymous blocks d. Parameters

c. Anonymous blocks

____are transactions created within another transaction. a. Pragma transactions b. Dynamic transactions c. Autonomous transactions d. Subprograms

c. Autonomous transactions

In the following code fragment, the IS keyword indicates that the ____. CREATE OR REPLACE PROCEDURE total_calc_sp (p_basket IN bb_basket.idbasket%TYPE, p_total OUT bb_basket.total%TYPE := 0 ) IS a. executable section follows b. exception handlers follow c. PL/SQL block follows d. function follows

c. PL/SQL block follows

____ are stored on the server. a. Stored procedures b. Application procedures c. Packages d. Database triggers

c. Packages

A(n) ____ contains a RETURN clause and is used to manipulate data and return a single resulting value. a. procedure b. application c. function d. database trigger

c. function

The following code is considered to be a ____. CREATE OR REPLACE PROCEDURE total_calc_sp (p_basket IN bb_basket.idbasket%TYPE, p_total OUT bb_basket.total%TYPE := 0 ) IS a. function header section b. PL/SQL block c. procedure header section d. DECLARE section

c. procedure header section

If a table column data type is modified, no changes to associated variables are required because the ____ attribute always uses the column's current data type. a. TYPE b. := c. => d. %TYPE

d. %TYPE

____ are saved in an Oracle11g application or library on the client-side. a. Stored procedure and functions b. Functions c. Packages d. Application procedures

d. Application procedures

The RAISE_APPLICATION_ERROR function accepts the ____ arguments. a. Error ID b. Error name c. Error length d. Error message

d. Error message

The DBMS_OUTPUT.PUT_LINE statement can be used to ____. a. assist with the creation of a cursor b. assist with the creation of an exception c. assist with creating functions d. assist with debugging your code

d. assist with debugging you code

When creating a procedure, each parameter is listed, along with a mode and ____. a. function b. package c. variable d. data type

d. data type

A(n) ____ performs tasks automatically when a DML action occurs on the table with which it is associated. a. package b. stored procedure c. application trigger d. database trigger

d. database trigger

The DBMS_OUTPUT statement is used to ____. a. create error messages b. create exceptions c. display exceptions to the screen d. display a message to the screen

d. display a message to the screen

The ____ area of a block determines what happens if an error occurs. a. transaction scope b. mode c. data type d. exception handling

d. exception handling

Three pieces of information for each parameter must be provided in the header: name, mode, and ____________________.

data type

The ____________________ area of a block determines what happens if an error occurs.

exception handling

A(n) ____________________ contains a RETURN clause and is used to manipulate data and return a single resulting value.

function

In a(n) ____________________, you associate a value to each parameter by name in the invoke statement.

named association


Ensembles d'études connexes

Michael Banks's Lines: Mary Poppins Jr.

View Set

Humanities I - Exam 1 - Borucki at PBA

View Set

Argus Clou, groep 7, thema 1 geschiedenis

View Set

Chapter 12: Experiments with More than One Independent Variable

View Set

AP Psychology-Sensation & Perception Module 18

View Set

Patho + Health Assessment: Cardio & Respiratory

View Set

DLC 115: The Roles, Duties, and Responsibilities of the Sergeant

View Set

Protein Synthesis, Mutations, and Viruses

View Set