Header Ads Widget

Responsive Advertisement

Module 03: Writing Executable Statements

Writing Executable Statements


01. Which statement is true about nesting blocks?

a. Variable name must be unique between blocks.

b. A variable defined in the outer block is visible in the inner blocks.

c. A variable defined in the inner block is visible in the outer blocks.

d. A variable is in an inner block may have the same name as a variable in an outer block only if the data types are different.

Answer: b

02. Which command could be issued within a PL/SQL block?

a. GRANT.

b. COMMIT.

c. DROP TABLE.

d. ALTER TABLE.

Answer: b

## Examine the following piece of code: -

<<outer>>

DECLARE

x NUMBER : = 1;

y NUMBER : = 2;

z VARCHAR2(50) : = ‘CNS’;

BEGIN

<<inner>>

DECLARE

x NUMBER;

y NUMBER : = outer.y  + 1;

z outer.z% TYPE : = ‘LIMITED’;

BEGIN

x : = x  + 1;

y: = Y  + 1;

Outer.z : = outer.z | | z;

dbms_output.put_line (x| |y| |z);

END inner;

dbms_output.put_line (x| |y| |z);

END outer;

03. What will the first output return (first underlined statement)?

a. 4LIMITED.

b. 24LIMITED.

c. 12CNSLIMITED.

d. 24CNSLIMITED.

Answer: a

04. What will the second output return (second Underlined statement)?

a. 12LIMITED.

b. 24LIMITED.

c. 12CNSLIMITED.

d. 2CNSLIMITED.

Answer: b

Post a Comment

0 Comments