Mode:
Duration:
1
2
3
4
5
6
7
8
9
DECLARE
fact NUMBER := 1;
i NUMBER;
BEGIN
FOR i IN 1..5 LOOP
fact := fact * i;
END LOOP;
DBMS_OUTPUT.PUT_LINE('Factorial: ' || fact);
END;Coding works best on desktop or with an external keyboard.
DECLARE
fact NUMBER := 1;
i NUMBER;
BEGIN
FOR i IN 1..5 LOOP
fact := fact * i;
END LOOP;
DBMS_OUTPUT.PUT_LINE('Factorial: ' || fact);
END;Coding works best on desktop or with an external keyboard.
Calculates factorial of 5 using a loop.
DECLARE
fact NUMBER := 1;
i NUMBER;
BEGIN
FOR i IN 1..5 LOOP
fact := fact * i;
END LOOP;
DBMS_OUTPUT.PUT_LINE('Factorial: ' || fact);
END;PL/SQL (Procedural Language/Structured Query Language) is Oracle Corporation's procedural extension to SQL. It combines SQL's data manipulation capabilities with procedural constructs like loops, conditions, and exceptions, enabling complex business logic execution directly within the database.
Origin & Creator
Developed by Oracle Corporation in the late 1980s to extend SQL with procedural capabilities.
Industrial Note
PL/SQL is the backbone of Oracle database applications, supporting triggers, stored procedures, and batch processing in enterprise environments.