Unit 8 Flashcards
structures allow a single command, or a group of statements, to be executed repeatedly
Loops
structures allow a single command, or a group of statements, to be executed repeatedly
While loops
There are three loop statements in MySQL
while, repeat and loop
loop statement is also known as post-test loop.
repeat
statement that allows you to execute a block of code repeatedly with an additional flexibility of using a loop label.
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
to terminate a single iteration of a loop you can use
CONTINUE
statement allows you to skip the entire code under it and start a new iteration.
ITERATE
means “start the loop again.”
ITERATE
BREAK and CONTINUE commands affect only the loop that they appear within. ie. when breaking out of an inner loop, control passes to the next statement after the inner loop, which will be within the outer loop.
Nesting Loops
is a database object that permits the data set generated by a query to be processed one row at a time.
Cursor
the query is executed and the cursor is populated.
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 _____ to free the resources associated with it and to clear any locks that the cursor has created.
close