In order to test your progress, you should be able to answer the following questions.
Which of the following are valid methods to initialize value for a variable?
_____ Declare a sequence
_____ The ":=" syntax
_____ SET SERVEROUTPUT ON
_____ SELECT INTO statement
Which of the following are valid DML or DDL statements in a PL/SQL Block?
_____ CREATE TABLE
_____ CREATE SEQUENCE
Complete the following statement with the correct syntax for inserting a sequence in a PL/SQL BLOCK.
INSERT INTO STUDENT (student_id, last_name)
_____ VALUES (student_id_seq.currval, 'Smith');
_____ VALUES ('Smith', student_id_seq.currval);
_____ VALUES (student_id_seq.nextval, 'Smith');
_____ VALUES (nextval, 'Smith');
Which of the following are true statements about an Oracle sequence?
_____ It can use a DML statement only in stand-alone SQL, not in a PL/SQL block.
_____ It is a database object.
_____ It is useful for generating contiguous numbers for invoicing .
_____ It can be used to generate unique primary keys.
Answers appear in Appendix A, Section 4.1 .