DEV Community

kim
kim

Posted on

2

PL/SQL Cheat Sheet

Below is PL/SQL - Loops Cheat Sheet:

Basic Loop

LOOP 
   The sequence of statements; 
END LOOP; 

WHILE Loop

WHILE condition LOOP 
   sequence_of_statements 
END LOOP; 

FOR Loop

FOR counter IN initial_value .. final_value LOOP 
   sequence_of_statements; 
END LOOP;

Nested Loops

  • Nested basic LOOP
LOOP 
   Sequence of statements1 
   LOOP 
      Sequence of statements2 
   END LOOP; 
END LOOP;
  • Nested FOR LOOP
FOR counter1 IN initial_value1 .. final_value1 LOOP 
   sequence_of_statements1 
   FOR counter2 IN initial_value2 .. final_value2 LOOP 
      sequence_of_statements2 
   END LOOP; 
END LOOP;
  • Nested WHILE LOOP
WHILE condition1 LOOP 
   sequence_of_statements1 
   WHILE condition2 LOOP 
      sequence_of_statements2 
   END LOOP; 
END LOOP; 

EXIT statement

EXIT;
CONTINUE statement
CONTINUE;

GOTO statement

GOTO label;
..
..
<< label >>
statement;

...
Full cheat sheet is here

Heroku

This site is built on Heroku

Join the ranks of developers at Salesforce, Airbase, DEV, and more who deploy their mission critical applications on Heroku. Sign up today and launch your first app!

Get Started

Top comments (0)

Postmark Image

Speedy emails, satisfied customers

Are delayed transactional emails costing you user satisfaction? Postmark delivers your emails almost instantly, keeping your customers happy and connected.

Sign up

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay