READ Free Dumps For Oracle- 1z0-001
Question ID 8144 | Under which situation it is necessary to use an explicit cursor?
|
Option A | When any DML or select statement is used in a PL/SQL block?
|
Option B | When a delete statement in a PL/SQL block deletes more than one row.
|
Option C | When a select statement in a PL/SQL block is more than one row.
|
Option D | When an update statement in a PL/SQL block has to modify more than one row
|
Correct Answer | C |
Explanation Explanation/Reference: Explanation: Answer C is correct because only an explicit cursor will be able to handle situation when statement returns more than one row. In all other situations every SQL statement executes in an implicit cursor, including UPDATE, INSERT, DELETE DML statements and SELECT statement. Incorrect Answers: A: Every SQL statement executes in an implicit cursor, including DML statements, like UPDATE, INSERT, DELETE, and also SELECT statement. B: DELETE statements in a PL/SQL code use an implicit cursor. D: UPDATE statements in a PL/SQL code use an implicit cursor. Oracle 8, DBA Certification Exam Guide, Jason S. Couchman, p. 226-227 Chapter 5: Introducing PL/SQL
Question ID 8145 | Examine the table instance chart for the patient table.
Column id_number last_name first_name birth_date doctor_id
name
Key type PK
NN, U NN NN
Nulls/Unique
FK table DOCTOR
FK column
ID_NUMBER
Data type NUM DATE NUM
VARCHAR2 VARCHAR2
Length 10 25 25 10
Which script would you use to delete the patient from the table by prompting the user for the id_number of the patient?
|
Option A | DELETE FROM patient WHERE id_number=&id_number /
|
Option B | DELETE FROM patient WHERE id_number=:id_number /
|
Option C | DELETE DEFINE & id_number FROM patient WHERE id_number=&id_number /
|
Option D | DEFINE: id_number DELETE FROM patient WHERE id_number=&id_number /
|
Option E | This task can't be accomplished.
|
Correct Answer | A |
Explanation Explanation/Reference: Explanation: Answer A is correct because this script will prompt the user for the id_number of the patient and than delete this patient from the table. Incorrect Answers: B: Syntax for substituted variable is not correct, ampersand & need to be used in the WHERE clause : WHERE id_number=&id_number. C: Usage DEFINE & id_number is not appropriate, because script will prompt user to enter id_number of the patient, not defining it in the script. Also the usage of DEFINE command inside DELETE ... FROM clause is wrong. D: Usage DEFINE: id_number is not appropriate, because script will prompt user to enter id_number of the patient, not defining it in the script. Also this syntax is wrong by using ':' after keyword DEFINE. E: This task can be successfully completed, answer A shows correct way to do this. Oracle 8, DBA Certification Exam Guide, Jason S. Couchman, p. 75-78 Chapter 2: Advanced Data Selection in Oracle