Practice PL - SQL 2-1
Practice PL - SQL 2-1
Practice PL - SQL 2-1
com/academy
VARIABLES
Used for storage of data and manipulation of stored values.
m
PARÁMETROS
er as
Values passed to a program by a user or by another program to
customize the program.
co
eH w
o.
Try It / Solve It
rs e
ou urc
1. Fill in the blanks.
block.
This study source was downloaded by 100000809939014 from CourseHero.com on 05-26-2021 13:40:18 GMT -05:00
https://www.coursehero.com/file/23153351/PLSQL-2-1-Practice/
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. Oracle and Java are registered trademarks of Oracle and/or its affiliates. Other names may be trademarks of their
respective owners.
3. Examine the following anonymous block and choose the appropriate statement.
DECLARE
fname VARCHAR2(25);
lname VARCHAR2(25) DEFAULT 'fernandez';
BEGIN
DBMS_OUTPUT.PUT_LINE(fname || ' ' || lname);
END;
m
er as
E. The block will give an error because the FNAME variable is not declared.
co
eH w
4. In Application Express:
o.
rs e
ou urc
A. Create the following function:
RETURN INTEGER AS
aC s
v_num_characters INTEGER;
vi y re
BEGIN
SELECT LENGTH(p_string) INTO v_num_characters
FROM dual;
RETURN v_num_characters;
ed d
END;
ar stu
is
Th
sh
This study source was downloaded by 100000809939014 from CourseHero.com on 05-26-2021 13:40:18 GMT -05:00
https://www.coursehero.com/file/23153351/PLSQL-2-1-Practice/
B. Create and execute the following anonymous block:
DECLARE
v_length_of_string INTEGER;
BEGIN
v_length_of_string := num_characters('Oracle Corporation');
DBMS_OUTPUT.PUT_LINE(v_length_of_string);
END;
m
er as
co
eH w
o.
rs e
ou urc
o
aC s
5. Write an anonymous block that uses a country name as input and prints the highest and
vi y re
lowest elevations for that country. Use the COUNTRIES table. Execute your block three
times using United States of America, French Republic, and Japan.
ed d
This study source was downloaded by 100000809939014 from CourseHero.com on 05-26-2021 13:40:18 GMT -05:00
https://www.coursehero.com/file/23153351/PLSQL-2-1-Practice/
FRENCH REPUBLIC:
JAPAN:
m
er as
co
eH w
o.
rs e
ou urc
o
aC s
vi y re
ed d
ar stu
is
Th
sh
This study source was downloaded by 100000809939014 from CourseHero.com on 05-26-2021 13:40:18 GMT -05:00
https://www.coursehero.com/file/23153351/PLSQL-2-1-Practice/
Powered by TCPDF (www.tcpdf.org)