Professional Documents
Culture Documents
(download pdf) Oracle 11G PL SQL Programming 2nd Edition Casteel Test Bank full chapter
(download pdf) Oracle 11G PL SQL Programming 2nd Edition Casteel Test Bank full chapter
https://testbankfan.com/product/oracle-11g-pl-sql-
programming-2nd-edition-casteel-solutions-manual/
https://testbankfan.com/product/oracle-11g-sql-2nd-edition-
casteel-test-bank/
https://testbankfan.com/product/oracle-12c-sql-3rd-edition-
casteel-test-bank/
https://testbankfan.com/product/oracle-12c-sql-3rd-edition-
casteel-solutions-manual/
Oracle 10g Database Administrator Implementation and
Administration 2nd Edition Powell Test Bank
https://testbankfan.com/product/oracle-10g-database-
administrator-implementation-and-administration-2nd-edition-
powell-test-bank/
https://testbankfan.com/product/guide-to-sql-9th-edition-pratt-
test-bank/
https://testbankfan.com/product/guide-to-sql-8th-edition-pratt-
test-bank/
https://testbankfan.com/product/guide-to-oracle-10g-5th-edition-
morrison-test-bank/
https://testbankfan.com/product/just-enough-programming-logic-
and-design-2nd-edition-farrell-test-bank/
CHAPTER 6 - FUNCTIONS
TRUE/FALSE
1. A function is quite similar to a procedure in that it is a program unit that achieves a task, can receive
input values, and returns values to the calling environment.
2. The main difference between functions and procedures is that a function is part of an expression.
4. The RETURN statement can return constant values, such as a text string.
7. The term “actual parameters” refers to the parameters that are listed in the program unit.
8. The term “formal parameters” refers to the arguments that are used when calling or invoking the
program unit.
9. Formal parameters including the RETURN data type cannot include size information.
10. The term “passed by value” means that a pointer to the value in the actual parameter is created instead
of copying the value from the actual parameter to the formal parameter.
11. The term “passed by reference” means that the value is copied from the actual parameter to the formal
parameter.
13. The following is a correct example of the use of the DROP command.
DROP function_name;
MODIFIED TRUE/FALSE
1. A(n) procedure is one type of program unit that is used to accomplish one or more tasks, return none
or many values, and is used only in PL/SQL statements. _________________________
2. A(n) procedure is part of an expression and cannot serve an entire statement. ____________________
ANS: F, function
ANS: F, function
4. In a(n) function, the RETURN statement includes no arguments and is followed with a semicolon.
_________________________
ANS: F, procedure
5. You cannot include data type information when declaring a formal parameter.
________________________
ANS: F, size
6. The term passed by value implies that a pointer to the value in the actual parameter is created instead
of copying the value from the actual parameter to the formal parameter.
_________________________
7. The term passed by reference implies that the value is copied from the actual parameter to the formal
parameter. _________________________
ANS: F, passed by value
8. The default behaviors of value passing can be overridden by using a compiler hint named NOCOPY.
_________________________
9. Functions cannot be used in a(n) CHECK constraint or as a default value of a table column.
_________________________
10. Deleting a program unit can be accomplished by issuing a(n) DEL command.
_________________________
ANS: F, DROP
MULTIPLE CHOICE
b. DECLARE
v_amt1 number(5,2);
v_amt2 number(3,0);
BEGIN
v_amt1 := 32.50;
v_amt2 := ROUND(v_amt1,1);
DBMS_OUTPUT.PUT_LINE(v_ amt2);
END;
c. DECLARE
v_amt1 number(5,2);
v_amt2 number(3,0);
BEGIN
v_amt1 := 32.50;
v_amt2 := ROUND v_amt1, 2;
DBMS_OUTPUT.PUT_LINE(v_ amt2);
END;
d. DECLARE
v_amt1 number(5,2);
v_amt2 number(3,0);
BEGIN
v_amt1 := 32.50;
v_amt2 := ROUND[v_amt1,0];
DBMS_OUTPUT.PUT_LINE(v_ amt2);
END;
4. At least one ____ statement must be included in a function body to instruct which value to return.
a. CREATE c. BEGIN
b. RETURN d. EXCEPTION
ANS: B PTS: 1 REF: 218
a. 1 c. 3
b. 2 d. 4
ANS: C PTS: 1 REF: 219
DECLARE
lv_name_txt VARCHAR2(35);
lv_id_num NUMBER(4) := 25;
lv_first_txt VARCHAR2(15) := 'Scott';
lv_last_txt VARCHAR2(20) := 'David';
BEGIN
lv_name_txt := memfmt1_sf(lv_id_num,lv_first_txt, lv_last_txt);
DBMS_OUTPUT.PUT_LINE(lv_name_txt);
END;
a. procedure c. parameter
b. function d. anonymous block
ANS: D PTS: 1 REF: 217
8. ____ refer to the parameters that are listed in the program unit.
a. Modes c. Procedures
b. Functions d. Formal parameters
ANS: D PTS: 1 REF: 228
9. ____ refer to the arguments that are used when calling or invoking the program unit.
a. Actual parameters c. Formal parameters
b. Functions d. Procedures
ANS: A PTS: 1 REF: 228
10. A good method to handle the size issue when declaring variables that hold values from a database table
is to use the ____ attribute to use the size of the database column.
a. NOCOPY c. << >>
b. %TYPE d. TYPE
ANS: B PTS: 1 REF: 219
11. A(n) ____ is a request a programmer includes within his or her code that asks Oracle to modify the
default processing in some manner.
a. compiler hint c. pass by reference
b. pass by value d. purity level
ANS: A PTS: 1 REF: 230
12. The term ____ is identified with a set of acronyms that indicate the restrictions on using the function.
a. compiler hint c. pass by reference
b. purity level d. pass by value
ANS: B PTS: 1 REF: 232
14. Functions used in SQL statements must meet all of the following requirements, except ____.
a. Must be a stored database object
b. Can use only OUT parameters
c. Return data types must be a database data type
d. Cannot issue ALTER SESSION or ALTER SYSTEM commands
ANS: B PTS: 1 REF: 232
15. All of the following are purity level acronyms, except ____.
a. WNDS c. WNPS
b. RINDS d. RNPS
ANS: B PTS: 1 REF: 232
16. The ____ purity level does not modify database tables.
a. WNDS c. RNPS
b. WNPS d. RNDS
ANS: A PTS: 1 REF: 232
17. Which of the following correctly creates a function that performs an update on the BB_TEST1 table?
a. CREATE OR REPLACE FUNCTION fct_test1_sf (p_num IN NUMBER)
RETURN NUMBER
IS
BEGIN
UPDATE bb_test1
SET col1 = p_num;
RETURN p_num;
END;
18. In the code below, which of the following is the parameter variable?
a. bb_test1 c. p_num
b. col1 d. fct_test1_sf
ANS: C PTS: 1 REF: 218
COMPLETION
ANS: function
ANS: Procedures
3. The task of the ____________________ function is to use the two arguments provided, a numeric
value and the degree of rounding, and return the resulting value.
ANS: ROUND
4. It is considered good form to return only one value from a function and to do so using the
____________________ statement.
ANS: RETURN
PTS: 1 REF: 226
ANS: size
ANS: DROP
ESSAY
ANS:
The main difference between functions and procedures is that a function is part of an expression. It
cannot serve as an entire statement. A procedure, on the other hand, can serve as an entire statement.
ANS:
The term formal parameters refers to the parameters that are listed in the program unit while the term
actual parameters refers to the arguments that are used when calling or invoking a program unit.
3. Discuss the techniques available in PL/SQL for passing values between actual parameters and formal
parameters.
ANS:
PL/SQL uses two techniques for passing values between actual parameters and formal parameters. In
the first method, IN parameter values are passed by reference, which means a pointer to the value in
the actual parameter is created instead of copying the value from the actual parameter to the formal
parameter. In the second, OUT and IN OUT parameters are passed by value in which the value is
copied from the actual to the formal parameter.
Agriculture
The agricultural products are insufficient for the use of the country
although 2,000,000 acres are in cultivation. About 900,000 acres are
in wheat, 700,000 in corn, 128,000 in flax, 100,000 oats, some
barley and canary seed. In 1916 agricultural exports were valued at
$1,500,000. Among other crops are tobacco, which is especially
promising, linseed, alfalfa, sugar cane, some cotton, potatoes, etc.
Viticulture is quite extensive, American grapes growing better in the
south, and French and Italian in the north. Other fruits, oranges,
olives, apples, pears, cherries, peaches, and melons flourish.
Forestry
Minerals
Manufactures
Investments
The country of Brazil, largest of the South American Republics, has also
a greater area than the United States without Alaska, and is more than
three-fourths the size of all Europe. It cannot therefore be considered as a
whole so easily as the other Republics. It is essential to differentiate
between the various regions and States; for the dissimilarity is not confined
to climate and productions; or to the character of the people, by reason of
some being indigenous and others of European descent. It arises in part
from the long coast line and the difficulty of land communication; in part
from the fact that in some districts the population is almost entirely of
European descent while in others there is a large percentage of negro
blood; as well as from differences in physical and climatic conditions. Thus
the Capital is not so markedly the centre of the Republic as in Argentina,
and the States are more loosely bound together than in the other
Republics. The States and the character of the people may be said to
differ as much among themselves as the countries of the West Coast from
each other, a point of importance to notice in commercial relations.
Area. Brazil covers a surface of 3,112,453 square miles. Its length, 2750
miles, is about that of Chile; its extreme width, 2560 miles, is ten times at
great. The coast-line is much longer, 4140 miles. A considerable portion of
this immense area is still but superficially explored.
Population. According to the cabled report of the census of 1920, Brazil
has 30,553,509 inhabitants. Its population, therefore, exceeds that of any
other South American Republic even more largely than its area.
Boundary. The boundary of the country, though familiar from that of the
others, may be rehearsed. On the north we find Colombia, Venezuela, and
the three Guianas with the Atlantic beyond; on the east and southeast the
Atlantic only, on the south Uruguay, a speck of Argentina, Paraguay,
Bolivia, a bit of Peru; on the west a small corner of Argentina, Paraguay,
Bolivia, and Peru. The only countries of the continent not touching its
border are Ecuador and Chile. However, a few writers mention Ecuador on
the west, as the southeast boundary line of that country is still
undetermined.
History
Government
Population
The population, by the recent census 30,553,509, is of a more varied
character than that of Uruguay and Argentina at the south. Some figures
given are 52 per cent white, 26 mixed, 13 Indian, and 9 per cent negro.
The original settlers were Portuguese, and at first immigration was from
the mother country. In the early days many negroes were imported from
Africa as slaves, yet there was little color prejudice so that the number of
mulattoes and lighter as well as of negroes in some sections is very large.
During the last hundred years over 3,000,000 immigrants have arrived,
of whom the Italians formed the larger proportion; next in number were the
Portuguese, half as many Spaniards; those of other nationalities included
100,000 Germans, and a small colony from our Southern States, who left
in disgust in 1867. The negroes, freed in 1888 and endowed with suffrage,
were less qualified for it than in the United States. While some have made
good advancement others have relapsed into a worse condition, being
able in many parts of the country to exist on almost nothing. Indolence is a
failing among many of all complexions, as is natural in tropical regions; on
the other hand many Brazilians even in the warmer sections are
characterized by great activity and industry. In the large cities culture and
elegance are noticeable and aristocracy of birth is cherished. In some
regions the inhabitants are less pretentious, live more simply, and practise
the homely virtues; the most primitive section according to Oakenfull is
between the São Francisco River and Maranhão. Women in general are
more secluded than in some of the other Republics. The Brazilians have
much literary and artistic taste and as a rule are punctilious in courtesy,
though exceptions may be noted.
Education
The Press is influential and of high quality, the leading papers of Rio,
São Paulo, and other cities comparing well with those of cities of
corresponding size in other parts of the world.
Religion. In Brazil there is entire separation of Church and State and
absolute religious freedom. Civil marriage alone is recognized.
Post and Telegraph. Brazil has 3700 Post Offices.
Telegraph wires (over 26,000 miles) are in part national; other lines
belong to the railways; there are submarine cables, and one up the
Amazon. Wireless stations have been installed at many points on the
coast and in the interior, including the Amazon district, as at Manaos and
beyond. Telephones are to be found in all cities of any considerable size,
about 80 systems.
Money is more complicated and bothersome than in any of the other
countries, the unit being of 1000 instead of 100 parts, as is usual. Thus the
milreis, written 1$000, equals 1000 reis as the name indicates. The milreis
of gold is equal to 54.6 cents, but exchange varies, and the paper in
common use varies from its ordinary value, 33.3 cents, to half that or even
less in disturbed conditions. A conto of reis, a term often used, is 1000
milreis, and is written with a colon, thus: 5 contos, 20 milreis, and 300 reis
would be written 5:20$300.
The Metric System is legal and compulsory, but in some places, the old
Portuguese measures persist; these differ from the Spanish. A vara in
Peru is less than a yard, but in Brazil it is 1.111 metre, or 1.215 yard. A
libra is 4.695 kilos; an alquiere varies from 24 to 160 litres. Other variety
exists in the same or in different places.
CHAPTER XLVI
BRAZIL: PHYSICAL CHARACTERISTICS
Climate