exam questions

Exam 1z0-148 All Questions

View all questions & answers for the 1z0-148 exam

Exam 1z0-148 topic 1 question 6 discussion

Actual exam question from Oracle's 1z0-148
Question #: 6
Topic #: 1
[All 1z0-148 Questions]

Which two blocks of code execute successfully?

  • A. DECLARE SUBTYPE new_one IS BINARY_INTERGER RANGE 0..9; my_val new_one; BEGIN my_val :=0; END;
  • B. DECLARE SUBTYPE new_string IS VARCHAR2 (5) NOT NULL; my_str_new_string; BEGIN my_str := abc; END;
  • C. DECLARE SUBTYPE new_one IS NUMBER (2, 1); my_val new_one; BEGIN my_val :=12.5; END;
  • D. DECLARE SUBTYPE new_one IS INTEGER RANGE 1..10 NOT NULL; my_val new_one; BEGIN my_val :=2; END;
  • E. DECLARE SUBTYPE new_one IS NUMBER (1, 0); my_val new_one; BEGIN my_val := -1;
Show Suggested Answer Hide Answer
Suggested Answer: AD 🗳️

Comments

Chosen Answer:
This is a voting comment (?). It is better to Upvote an existing comment if you don't have anything to add.
Switch to a voting comment New
Nisha1
Highly Voted 5 years, 5 months ago
AE A : successfully completed but some keyword should be in lower case DECLARE SUBTYPE new_one IS binary_integer range 0..9; my_val new_one; BEGIN my_val :=0; dbms_output.put_line(my_val); END; B : PLS-00218: a variable declared NOT NULL must have an initialization assignment C : ORA-06502: PL/SQL: numeric or value error: number precision too large D : PLS-00218: a variable declared NOT NULL must have an initialization assignment E : Correct
upvoted 12 times
...
Rakeshpro
Most Recent 2 years, 4 months ago
DECLARE SUBTYPE new_one IS BINARY_INTEGER RANGE 0..9; my_val new_one; --SUBTYPE new_string IS VARCHAR2 (5) NOT NULL; -- PLS-00218: a variable declared NOT NULL must have an initialization assignment --my_str new_string; SUBTYPE new_one_1 IS NUMBER (2,1); my_val_1 new_one; --SUBTYPE new_one_2 IS INTEGER RANGE 1..10 NOT NULL; -- PLS-00218: a variable declared NOT NULL must have an initialization assignment --my_val_2 new_one_2; SUBTYPE new_one_3 IS NUMBER (1,0); my_val_3 new_one_3; BEGIN my_val := 0; --my_str := 'abc'; --my_val_1 := 12.5; -- ORA-06502: PL/SQL: numeric or value error --my_val_2 := 2; my_val_3 := -1; END; /
upvoted 1 times
...
Josephgreenson
3 years, 1 month ago
Selected Answer: AE
A : successfully completed but some keyword should be in lower case DECLARE SUBTYPE new_one IS binary_integer range 0..9; my_val new_one; BEGIN my_val :=0; dbms_output.put_line(my_val); END; B : PLS-00218: a variable declared NOT NULL must have an initialization assignment C : ORA-06502: PL/SQL: numeric or value error: number precision too large D : PLS-00218: a variable declared NOT NULL must have an initialization assignment E : Correct
upvoted 1 times
...
CosminCof
4 years, 2 months ago
AE is the correct answer
upvoted 1 times
...
peguynya
4 years, 7 months ago
A,E are corrects but in A you just have to write integer not interger, and in E just add the END keyword
upvoted 1 times
...
Zayas
5 years ago
AE are corrects , only E need "END" keyword
upvoted 4 times
...
Swetank123
5 years, 3 months ago
Correct Answer is AE not AD because subtype which is not null should be initialized in D option.
upvoted 4 times
...
Community vote distribution
A (35%)
C (25%)
B (20%)
Other
Most Voted
A voting comment increases the vote count for the chosen answer by one.

Upvoting a comment with a selected answer will also increase the vote count towards that answer by one. So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.

SaveCancel
Loading ...
exam
Someone Bought Contributor Access for:
SY0-701
London, 1 minute ago