unit 8 Flashcards
A structures allow a single command, or a group of statements, to be executed repeatedly.
Loops
are commonly used with cursors to process a set of data one row at a time
WHILE loops
statement checks the expression after the execution of statements therefore the ——– statement is also known as post-test loop
REPEAT loop
This command specifies that the control should pass to the command immediately following the current loop.
BREAK
is used to exit the flow control construct that has the given label.
LEAVE
If you wish to terminate a single iteration of a loop
CONTINUE
This command immediately stops the current iteration and rechecks the loop’s condition. If the condition is still true, the loop is restarted.
CONTINUE
statement allows you to skip the entire code under it and start a new iteration.
ITERATE
Loops can be ——- to provide more complex looping structures. When nesting loops, BREAK and CONTINUE commands affect only the loop that they appear within.
Nesting
A ——is a database object that permits the data set generated by a query to be processed one row at a time.
cursor
A cursor cannot be used until it has been opened using the ——statement
OPEN
The cursor declared above is a forward-only cursor. This means that it is only possible to advance through the rows one by one. It is not possible to jump to a specific position, skip rows or to reverse through the data
FETCH NEXT
Once you have finished working with a cursor it must be closed to free the resources associated with it and to clear any locks that the cursor has created.
Closing a Cursor
To release these structures and destroy the cursor after closing you should ——– it.
Deallocating a Cursor
cursor is not affected by changes to the underlying data.
insensitive