Deck 4: Cursors and Exception Handling
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
فتح الحزمة
قم بالتسجيل لفتح البطاقات في هذه المجموعة!
Unlock Deck
Unlock Deck
1/65
العب
ملء الشاشة (f)
Deck 4: Cursors and Exception Handling
1
Implicit and explicit cursors are considered dynamic because they are associated with specific queries.
False
2
A cursor variable assigns a name to a work area holding a specific result set, whereas an explicit cursor is simply a pointer to a work area in which a query can be processed.
False
3
In PL/SQL, comment text is not executed.
True
4
A FORALL statement can process a group of rows in a DML operation.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 65 في هذه المجموعة.
فتح الحزمة
k this deck
5
Bulk processing options can have a detrimental effect on performance.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 65 في هذه المجموعة.
فتح الحزمة
k this deck
6
In Oracle, if the UPDATE statement does not affect any rows, an error is raised.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 65 في هذه المجموعة.
فتح الحزمة
k this deck
7
Some cursor variables are references or pointers to a specific work area.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 65 في هذه المجموعة.
فتح الحزمة
k this deck
8
Explicit cursors are declared automatically for all DML and SELECT statements issued within a PL/SQL block.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 65 في هذه المجموعة.
فتح الحزمة
k this deck
9
You can process multiple rows of data from a database by creating explicit cursors.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 65 في هذه المجموعة.
فتح الحزمة
k this deck
10
Implicit cursors are considered static because they are associated with specific queries. _________________________
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 65 في هذه المجموعة.
فتح الحزمة
k this deck
11
Three arguments are required in a PRAGMA EXCEPTION_INIT statement.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 65 في هذه المجموعة.
فتح الحزمة
k this deck
12
When referencing SQL attributes, the attribute information always reflects the information from the most recent SQL statement processed.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 65 في هذه المجموعة.
فتح الحزمة
k this deck
13
An exception is a mechanism to trap an error that occurs in processing.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 65 في هذه المجموعة.
فتح الحزمة
k this deck
14
Implicit cursors are declared and manipulated in the PL/SQL block code for handling a set of rows returned by a SELECT statement. _________________________
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 65 في هذه المجموعة.
فتح الحزمة
k this deck
15
If the INTO clause of a SELECT statement contains either scalar or record variables and if more than one row is selected, the TOO_MANY_ROWS error is raised. _________________________
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 65 في هذه المجموعة.
فتح الحزمة
k this deck
16
A SELECT statement within a PL/SQL block has the possibility of raising the NO_DATA_FOUND exception.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 65 في هذه المجموعة.
فتح الحزمة
k this deck
17
A(n) PRAGMA statement instructs Oracle to use some additional information provided when compiling and executing a block. _________________________
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 65 في هذه المجموعة.
فتح الحزمة
k this deck
18
Implicit cursors are declared and manipulated in the PL/SQL block code for handling a set of rows returned by a SELECT statement.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 65 في هذه المجموعة.
فتح الحزمة
k this deck
19
A(n) EXCEPTION statement within a PL/SQL block has the possibility of raising the NO_DATA_FOUND or TOO_MANY_ROWS exception. _________________________
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 65 في هذه المجموعة.
فتح الحزمة
k this deck
20
In PL/SQL, if a SELECT statement returns no rows, Oracle does not return an error.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 65 في هذه المجموعة.
فتح الحزمة
k this deck
21
An error raised in the executable section of a block immediately moves processing to the EXCEPTION section of the block in search of an exception handler. _________________________
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 65 في هذه المجموعة.
فتح الحزمة
k this deck
22
The ____ action used in an explicit cursor processes the query and creates an active set of rows available in the cursor.
A) DECLARE
B) OPEN
C) FETCH
D) CLOSE
A) DECLARE
B) OPEN
C) FETCH
D) CLOSE
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 65 في هذه المجموعة.
فتح الحزمة
k this deck
23
A(n) ____ represents a work area or section of memory in which an SQL statement is being processed in the Oracle server.
A) collection
B) variable
C) cursor
D) nested table
A) collection
B) variable
C) cursor
D) nested table
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 65 في هذه المجموعة.
فتح الحزمة
k this deck
24
The ____ action used with an explicit cursor creates a named cursor identified by a SELECT statement.
A) OPEN
B) DECLARE
C) FETCH
D) CLOSE
A) OPEN
B) DECLARE
C) FETCH
D) CLOSE
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 65 في هذه المجموعة.
فتح الحزمة
k this deck
25
A(n) ____ is a mechanism to trap an error that occurs in processing.
A) EXCEPTION
B) UPDATE
C) Exception handler
D) GOTO
A) EXCEPTION
B) UPDATE
C) Exception handler
D) GOTO
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 65 في هذه المجموعة.
فتح الحزمة
k this deck
26
Because Oracle does not raise an error if a(n) UPDATE does not affect any rows, you must include specific instructions in the block to raise an error if no rows are updated. _________________________
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 65 في هذه المجموعة.
فتح الحزمة
k this deck
27
____ are declared and manipulated in the PL/SQL block code for handling a set of rows returned by a SELECT statement.
A) Implicit cursors
B) Collections
C) Index-by tables
D) Explicit cursors
A) Implicit cursors
B) Collections
C) Index-by tables
D) Explicit cursors
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 65 في هذه المجموعة.
فتح الحزمة
k this deck
28
____ are values passed into the cursor when opened and used in the SELECT statement of the cursor to determine what value it will contain.
A) Collections
B) Subqueries
C) Parameters
D) Variables
A) Collections
B) Subqueries
C) Parameters
D) Variables
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 65 في هذه المجموعة.
فتح الحزمة
k this deck
29
____ refers to a SELECT statement in a PL/SQL block that retrieves more than one row.
A) NO_DATA_FOUND
B) ZERO_DIVIDE
C) CASE_NOT_FOUND
D) TOO_MANY_ROWS
A) NO_DATA_FOUND
B) ZERO_DIVIDE
C) CASE_NOT_FOUND
D) TOO_MANY_ROWS
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 65 في هذه المجموعة.
فتح الحزمة
k this deck
30
The RAISE_APPLICATION_ERROR is an Oracle built-in procedure that allows the developer to associate their own error number and message to an error. _________________________
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 65 في هذه المجموعة.
فتح الحزمة
k this deck
31
____ are declared automatically for DML and SELECT statements issued within a PL/SQL block.
A) Implicit cursors
B) Index-by Tables
C) Assignment statements
D) Collections
A) Implicit cursors
B) Index-by Tables
C) Assignment statements
D) Collections
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 65 في هذه المجموعة.
فتح الحزمة
k this deck
32
Oracle supplies a set of ____ or names associated with common Oracle errors.
A) predefined exceptions
B) looping constructs
C) exception handlers
D) Searched CASES
A) predefined exceptions
B) looping constructs
C) exception handlers
D) Searched CASES
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 65 في هذه المجموعة.
فتح الحزمة
k this deck
33
What can be used to simplify processing each row of a set retrieved from a database?
A) CURSOR
B) CURSOR For LOOP
C) LOOP
D) CURSOR Attribute
A) CURSOR
B) CURSOR For LOOP
C) LOOP
D) CURSOR Attribute
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 65 في هذه المجموعة.
فتح الحزمة
k this deck
34
____ refers to a SELECT statement in a PL/SQL block that retrieves no rows.
A) TOO_MANY_ROWS
B) NO_DATA_FOUND
C) ZERO_DIVIDE
D) DUP_VAL_ON_INDEX
A) TOO_MANY_ROWS
B) NO_DATA_FOUND
C) ZERO_DIVIDE
D) DUP_VAL_ON_INDEX
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 65 في هذه المجموعة.
فتح الحزمة
k this deck
35
An exception that has been declared must be referred to in the RAISE statement or a PL/SQL error will occur. _________________________
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 65 في هذه المجموعة.
فتح الحزمة
k this deck
36
The ____ section of a PL/SQL block addresses two situations: either an Oracle error is raised or a user-defined error is raised.
A) DECLARE
B) BEGIN
C) EXCEPTION
D) UPDATE
A) DECLARE
B) BEGIN
C) EXCEPTION
D) UPDATE
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 65 في هذه المجموعة.
فتح الحزمة
k this deck
37
The SQLCODE function returns the Oracle error message. _________________________
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 65 في هذه المجموعة.
فتح الحزمة
k this deck
38
The SQLERRM function returns the Oracle error number. _________________________
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 65 في هذه المجموعة.
فتح الحزمة
k this deck
39
____ refers to a condition where there is no WHEN clause in the CASE statement.
A) CASE_NOT_FOUND
B) ZERO_DIVIDE
C) DUP_VAL_ON_INDEX
D) NO_DATA_FOUND
A) CASE_NOT_FOUND
B) ZERO_DIVIDE
C) DUP_VAL_ON_INDEX
D) NO_DATA_FOUND
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 65 في هذه المجموعة.
فتح الحزمة
k this deck
40
The ____ action used with an explicit cursor clears the active set of rows and frees the memory area used for the cursor.
A) CLOSE
B) OPEN
C) DECLARE
D) FETCH
A) CLOSE
B) OPEN
C) DECLARE
D) FETCH
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 65 في هذه المجموعة.
فتح الحزمة
k this deck
41
A(n) ____________________ is one that a developer explicitly raises in the block to enforce a business rule.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 65 في هذه المجموعة.
فتح الحزمة
k this deck
42
The ____ option groups rows of queries or DML statements for processing.
A) FORALL
B) COLLECT BULK
C) BULK COLLECT
D) LIMIT
A) FORALL
B) COLLECT BULK
C) BULK COLLECT
D) LIMIT
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 65 في هذه المجموعة.
فتح الحزمة
k this deck
43
Which of the following statements is correct?
A) The value of the SQLCODE can be used directly in an SQL statement.
B) The value of the SQLCODE is assigned to a variable.
C) The value of the SQLCODE can not be assigned to a variable.
D) The value of the SQLERRM can be used directly in an SQL statement.
A) The value of the SQLCODE can be used directly in an SQL statement.
B) The value of the SQLCODE is assigned to a variable.
C) The value of the SQLCODE can not be assigned to a variable.
D) The value of the SQLERRM can be used directly in an SQL statement.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 65 في هذه المجموعة.
فتح الحزمة
k this deck
44
____ refers to an attempted violation of a unique or primary key column constraint.
A) NO_DATA_FOUND
B) TOO_MANY_ROWS
C) DUP_VAL_ON_INDEX
D) CASE_NOT_FOUND
A) NO_DATA_FOUND
B) TOO_MANY_ROWS
C) DUP_VAL_ON_INDEX
D) CASE_NOT_FOUND
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 65 في هذه المجموعة.
فتح الحزمة
k this deck
45
The ____ handler should always be the last handler listed in the EXCEPTION section of a block.
A) TOO_MANY_ROWS
B) NO_DATA_FOUND
C) EXIT WHEN
D) WHEN OTHERS
A) TOO_MANY_ROWS
B) NO_DATA_FOUND
C) EXIT WHEN
D) WHEN OTHERS
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 65 في هذه المجموعة.
فتح الحزمة
k this deck
46
If the ____________________ clause of a SELECT statement contains either scalar or record variables and if more than one row is selected, the TOO_MANY_ROWS error is raised.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 65 في هذه المجموعة.
فتح الحزمة
k this deck
47
____ is required in a PRAGMA EXCEPTION_INIT statement.
A) LOOP
B) Exception name
C) Predefined error
D) INIT code
A) LOOP
B) Exception name
C) Predefined error
D) INIT code
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 65 في هذه المجموعة.
فتح الحزمة
k this deck
48
An attempted violation of a unique or primary key column constraint causes the ____________________ exception.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 65 في هذه المجموعة.
فتح الحزمة
k this deck
49
Which of the following statements is correct?
A) An exception that has been declared must be referred to in the RAISE statement, or a PL/SQL error will occur.
B) An exception that has not been declared must be referred to in the RAISE statement, or a PL/SQL error will occur.
C) An exception that has been declared must not be referred to in the RAISE statement, or a PL/SQL error will occur.
D) An exception that has been declared must be referred to in the SELECT statement, or a PL/SQL error will occur.
A) An exception that has been declared must be referred to in the RAISE statement, or a PL/SQL error will occur.
B) An exception that has not been declared must be referred to in the RAISE statement, or a PL/SQL error will occur.
C) An exception that has been declared must not be referred to in the RAISE statement, or a PL/SQL error will occur.
D) An exception that has been declared must be referred to in the SELECT statement, or a PL/SQL error will occur.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 65 في هذه المجموعة.
فتح الحزمة
k this deck
50
Predefined exceptions are declared in the ____________________ package, which makes these globally available on the system.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 65 في هذه المجموعة.
فتح الحزمة
k this deck
51
Because Oracle does not raise an error if a(n) ____________________ does not affect any rows, you must include specific instructions in the block.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 65 في هذه المجموعة.
فتح الحزمة
k this deck
52
The ____ option specifies the number of rows to process as a group.
A) FORALL
B) NUMROWS
C) BULK COLLECT
D) LIMIT
A) FORALL
B) NUMROWS
C) BULK COLLECT
D) LIMIT
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 65 في هذه المجموعة.
فتح الحزمة
k this deck
53
____ has the possibility of raising the NO_DATA_FOUND or TOO_MANY_ROWS exception.
A) DECLARE
B) SELECT
C) CASE
D) LOOP
A) DECLARE
B) SELECT
C) CASE
D) LOOP
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 65 في هذه المجموعة.
فتح الحزمة
k this deck
54
A(n) ____ is one that a developer explicitly raises in the block to enforce a business rule.
A) predefined exception
B) exception
C) user-defined exception
D) error
A) predefined exception
B) exception
C) user-defined exception
D) error
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 65 في هذه المجموعة.
فتح الحزمة
k this deck
55
____ is used to trap errors not specifically addressed in one of the exception handlers.
A) WHERE
B) EXIT WHEN
C) WHEN OTHERS
D) EXCEPTION
A) WHERE
B) EXIT WHEN
C) WHEN OTHERS
D) EXCEPTION
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 65 في هذه المجموعة.
فتح الحزمة
k this deck
56
____ returns the Oracle error message.
A) EXIT WHEN
B) SQLCODE
C) SQLERR
D) SQLERRM
A) EXIT WHEN
B) SQLCODE
C) SQLERR
D) SQLERRM
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 65 في هذه المجموعة.
فتح الحزمة
k this deck
57
A(n) ____________________ statement within a PL/SQL block has the possibility of raising the NO_DATA_FOUND or TOO_MANY_ROWS exception.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 65 في هذه المجموعة.
فتح الحزمة
k this deck
58
An attempted division by zero causes the ____________________ exception.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 65 في هذه المجموعة.
فتح الحزمة
k this deck
59
The ____ is an Oracle built-in procedure that allows developers to associate their own error number and message to an error.
A) SQLCODE
B) SQLERRM
C) RAISE_APPLICATION_ERROR
D) WHEN OTHERS
A) SQLCODE
B) SQLERRM
C) RAISE_APPLICATION_ERROR
D) WHEN OTHERS
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 65 في هذه المجموعة.
فتح الحزمة
k this deck
60
The ____________________ function returns the Oracle error number.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 65 في هذه المجموعة.
فتح الحزمة
k this deck
61
A good programming practice is to include ____________________ in your code to document what is being accomplished throughout the program.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 65 في هذه المجموعة.
فتح الحزمة
k this deck
62
What is the difference between an explicit and an implicit cursor?
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 65 في هذه المجموعة.
فتح الحزمة
k this deck
63
When processing many rows in a query, ____________________ can be used to improve performance.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 65 في هذه المجموعة.
فتح الحزمة
k this deck
64
What is the difference between a predefined exception and a user-defined exception?
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 65 في هذه المجموعة.
فتح الحزمة
k this deck
65
Discuss the meaning of the term exception handler.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 65 في هذه المجموعة.
فتح الحزمة
k this deck