Skip to content

Coder Tutorial

Menu
  • Home
  • HTML
  • CSS
  • PHP
  • SQL
  • MySQL
  • JS
  • PL/SQL
  • Python
  • Java
  • Oracle
Home
PL/SQL
PL/SQL For Loop

PL/SQL For Loop

PL/SQL For Loop

Example 1:

DECLARE
	x number:=0;
BEGIN
	FOR i IN 1 .. 5 
	LOOP 
		x:= i; 
		DBMS_OUTPUT.PUT_LINE (' x= ' || x);
	END LOOP;
END;

Example 2:

BEGIN
	FOR i IN 1 .. 5 
	LOOP 
		IF i NOT IN (1,5) THEN 
			DBMS_OUTPUT.PUT_LINE ('i = ' || i);
		END IF;
	END LOOP;
END;

Tutorials

  • PL/SQL Tutorial
  • PL/SQL Blocks
  • PL/SQL Variables
  • PL/SQL Control structures
  • PL/SQL Collections and Records
  • PL/SQL Cursors
  • PL/SQL Stored Procedures
  • PL/SQL Functions
  • PL/SQL Packages
  • PL/SQL Exception Handling
  • PL/SQL Triggers
  • PL/SQL If-Then-Else Statement
  • PL/SQL For Loop
  • PL/SQL While Loop
  • PL/SQL Case Statement
  • PL/SQL Varray
  • PL/SQL Nested Table
  • PL/SQL Indexed Arrays
  • PL/SQL Record
  • PL/SQL Examples
  • Oracle PL/SQL Functions
  • PL/SQL Interview Questions

Recent Posts

  • PostgreSQL ERROR: cannot begin/end transactions in PL/pgSQL
  • PostgreSQL Column must appear in the GROUP BY clause
  • PostgreSQL Column specified more than once
  • PostgreSQL Create database, Alter database examples
  • PostgreSQL Create schema syntax, Alter schema
Coder Tutorial Copyright © 2023. | Privacy Policy
Back to Top ↑