wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

PL SQL

Total questions: 20

Worksheet time: 28mins

Name
Class
Date
1.
a)

v_num is Null

b)

v_num is NOT Null

c)

compilation error

d)

runtime error

2.
a)

v_num is not equal to v_char

b)

compilation error

c)

v_num is equal to v_char

d)

runtime error

3.

Which error occurs while the program is running and cannot be detected by the PL/SQL compiler?

a)

Syntax error

b)

Runtime error

c)

Both A & B

d)

None of the above

4.

Which keyword is used instead of the assignment operator to initialize variables?

a)

NOT NULL

b)

DEFAULT

c)

%TYPE

d)

%ROWTYPE

5.

Which statements execute a sequence of statements multiple times?

a)

EXIT

b)

LOOP

c)

Both A & B

d)

None of the above

6.

Oracle predefined errors are NOT associated with specific error codes.

a)

True

b)

False

7.

Which of the following returns the current error message text?

a)

SQLERRM

b)

SQLCODE

c)

Both A & B

d)

None of the above

8.

Which datatypes are PL/SQL-only datatypes that are more efficient than the

SQL datatypes NUMBER or INTEGER for integer arithmetic?

a)

PLS_INTEGER

b)

NUMBER

c)

Both A & B

d)

None of the above

9.

How many rows will be inserted And what will be the value

a)

0,No value

b)

99, 2 in all rows

c)

1,2 

d)

99,2 to 99

10.

PL/SQL has two types of subprograms, procedures and functions. Which subprogram is used to compute a value?

a)

Procedure

b)

Function

c)

Both A & B

d)

None of the above

11.

________ does not correlate with an oracle error, instead, user_define

exceptions usually enforce business rules in situations

in which an oracle error would not necessarily occur

a)

Predefined Exception

b)

Internal Exception

c)

User defined Exception

d)

None of the above

12.

Which choice shows what I will see on the screen after the following block is executed?

a)

-1

VALUE_ERROR

b)

-1

TOO_MANY_ROWS

c)

3

NO ERROR

d)

1

NO ERROR

13.

For a user-defined exception, SQLCODE returns 1, and SQLERRM returns ___________.

a)

“User-defined Exception”

b)

1

c)

0

d)

d.

14.

Which of the following is handled with the help of exception-handling section in an PL/SQL block.

For eg, SELECT INTO statement, which does not return any rows.

a)

A runtime error

b)

A syntax error

c)

Both A & B

d)

None of the above

15.

To handle raised exceptions, you write separate routines called exception handlers.

a)

Yes

b)

No

16.

I write the following block of code:


BEGIN

RAISE PROGRAM_ERROR;

EXCEPTION

##REPLACE##

END;

/

Which of the choices can be substituted in place of ##REPLACE## so that after

the resulting block is executed "PL/SQL is fantastic!" (without the double quotes)

will be displayed on the screen?

a)

WHEN PROGRAM_ERROR

THEN

DBMS_OUTPUT.put_line ('PL/SQL is fantastic!');

b)

WHEN PROGRAM_ERROR

THEN

DECLARE

l_fact VARCHAR2 (100) := 'PL/SQL is fantastic!';

BEGIN

DBMS_OUTPUT.put_line (l_fact);

END;

c)

WHEN OTHERS

THEN

DBMS_OUTPUT.put_line ('PL/SQL is fantastic!');

d)

Non of the above

17.

Which statement is correct regarding %typeb

a)

a

b)

b

c)

c

d)

d

18.
a)

True

b)

False

19.
a)

a

b)

b

c)

c

20.
a)

Row deleted

b)

No rows deleted

c)

compilation error

d)

None of the above