![]() |
|||
|
![]() |
![]() |
|
FULL A - Z Oracle Function Library (formerly named "Morgan's Library")
![]() Term: FOR
Definition: FOR <var> IN <start>..<finish> LOOP The <loop_body> is where calculations are done, results are processed, INSERTs, DELETEs or UPDATEs are performed, or other code is executed. This example FOR LOOP counts from 1 to 5: BEGIN The line FOR i IN 1..5 LOOP tells the loop's internal counter to start at 1 and continue looping until the counter reaches 5. The counter can also be an expression which tests one or more conditions, for example, the number of rows inserted, the time and/or date, or the value of a variable. The line beginning with DBMS_OUTPUT is the body of the loop where code is executed. Nearly any valid SQL, DML, or DDL statements or statements can be placed in the body of the loop to be executed, processed, or acted upon. Related Code Snippets:
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() |
![]() |
Home | Search | Code Library | Sponsors | Privacy | Terms of Use | Contact Us | © 2003 - 2025 psoug.org |