- PL/SQL Programming Fundamentals
- Exercises
- Exercise Answers
- Self-Review Questions
- Test Your Thinking
Lab 3.1 Self-Review Questions
In order to test your progress, you should be able to answer the following questions.
If a variable is declared as follows, what are the results?
v_fixed_amount CONSTANT NUMBER;
a) _____
A NUMBER variable called v_fixed_amounthas been declared (it will remain as a constant once initialized).
b) _____
A NUMBER variable called v_fixed_amounthas been declared (it will remain as null).
c) _____
An error message will result because constant initialization must be done in the executable section of the block.
d) _____
An error message will result because the declaration for the CONSTANT is missing an assignment to a NUMBER.
Which of the following are valid character types for PL/SQL?
a) _____
Numbers
b) _____
English letters
c) _____
Paragraph returns
d) _____
Arithmetic symbols
e) _____
Japanese Kanji
A variable may be used for which of the following?
a) _____
To hold a constant, such as the value of p
b) _____
To hold the value of a counter that keeps changing
c) _____
To place a value that will be inserted into the database
d) _____
To hold onto the function of an operand
e) _____
To hold any value as long as you declare it
Which of the following will declare a variable that is of the identical data type as the student_idin the database table STUDENT in the CTA database?
a) _____
v_id student_id := 123;
b) _____
v_id binary integer;
c) _____
v_id numberNUMBER:= 24;
d) _____
v_id student_id%type;
The value of a variable is set to null after the 'end;' of the block is issued.
a) _____
True
b) _____
False