Which line in the above declaration would generate an error?

Examine the following DECLARE section of PL/SQL block:

Which line in the above declaration would generate an error?

Examine the following DECLARE section of PL/SQL block:

Which line in the above declaration would generate an error?

A.
Line 2

B.
Line 3

C.
Line 4

D.
Line 5

E.
Line 6



Leave a Reply 18

Your email address will not be published. Required fields are marked *


Rose

Rose

answer: A

DECLARE
V_PP VARCHAR2 :=’TEMP’;
v_MM DATE:=SYSDATE;
V_BB DATE:= SYSDATE+10;
V_CC CONSTANT NUMBER(2):=2.23;
V_DD BOOLEAN NOT NULL DEFAULT TRUE;
BEGIN
NULL;
END;

Result
Error report –
ORA-06550: linha 2, coluna 6:

Tr

Tr

Explanation:
Error report –
ORA-06550: line 2, column 12:
PLS-00215: String length constraints must be in range (1 .. 32767)

Alisa

Alisa

datatype: numeric(p,s)

Where p is a precision value; s is a scale value. For example, numeric(6,2) is a number that has 4 digits before the decimal and 2 digits after the decimal.

Jen

Jen

DECLARE
V_PA VARCHAR2 :=’a’; <== error, ORA-06550 String length must be in range (1 .. 32767)
V_PA VARCHAR2(1) :='abc'; <== error
V_PA VARCHAR2(5) :='abc';
V_DD BOOLEAN NOT NULL DEFAULT TRUE; <== fine
BEGIN
NULL;
END;

Andreea

Andreea

Correct answer is A.

Xinqi

Xinqi

What about D, line 5. NUMBER(2) means NUMBER(2,0), length 2, 0 digits after decimal point, but here 8.25 is assigned.

Xinqi

Xinqi

A is also wrong, I think AD

me

me

0.25 in line 5 will be just rounded, resulting in c_tax_rate = 8

so, the answer is A only

Harlan Janikowski

Harlan Janikowski

This is the best search system in the planet

http://google.com

Halun Wanikowski

Halun Wanikowski

are u from outside planet???