PL/SQL, the procedural language for the Oracle Database, offers several types of loops that can be used to perform repetitive tasks. In this tutorial, we will explore the different types of loops available in PL/SQL, including the basic loop structure, ...
Discy Latest Articles
How to Declare a Variable in PL/SQL?
Vinish KapoorIntroduction In this tutorial, we will cover the basics of declaring variables in PL/SQL. Variable Declaration In PL/SQL, a variable is a storage location that holds a value. To declare a variable, you need to specify its data type and ...
How to Print in PL/SQL?
Vinish KapoorIntroduction PL/SQL (Procedural Language/Structured Query Language) is a programming language for managing and manipulating data in Oracle databases. In this tutorial, we will cover the basics of printing in PL/SQL. Printing in PL/SQL PL/SQL provides several ways to print or ...
PL/SQL Program to Check if Number is Prime
Vinish KapoorHere is a simple PL/SQL program that you can use to check if a number is prime: declare -- Declare a variable to hold the number num number := 5; -- Declare a variable to hold the result is_prime boolean ...
PL/SQL Program to Find Area of Circle
Vinish KapoorThe area of a circle is the measure of the two-dimensional region enclosed by the circle. It is defined as the product of the radius of the circle squared and pi (approximately 3.14159). Here is a simple PL/SQL program that ...
PL/SQL Program to Print Hello World
Vinish KapoorHere is an example PL/SQL program that you can use to print "Hello, World!". What is a Hello World Program? A "Hello, World!" program is a simple computer program that outputs the text "Hello, World!" to the screen. It is ...
PL/SQL Program to Display Student Details
Vinish KapoorHere is an example of a PL/SQL program to display student details: Example DECLARE -- Declare variables to hold student details student_name VARCHAR2(100); student_id NUMBER; student_grade NUMBER; -- Declare a cursor to fetch student details from the database CURSOR student_cur ...
PL/SQL Programming Basics
Vinish KapoorPL/SQL is a procedural language extension for SQL, the structured query language for managing data in relational databases. It is a high-level language that provides a powerful and flexible way to develop programs that interact with a database. SQL in ...
PL/SQL Program to Create Table
Vinish KapoorTo create a table inside a PL/SQL block, you can use the EXECUTE IMMEDIATE statement, which allows you to execute a dynamic SQL or PL/SQL statement. Here is an example of how you can use this statement to create a ...
PL/SQL Program to Check a Number is Even/Odd
Vinish KapoorHere is a PL/SQL program that can determine whether a number is even or odd: DECLARE num NUMBER; BEGIN num := # IF MOD(num, 2) = 0 THEN DBMS_OUTPUT.PUT_LINE('The number ' || num || ' is even.'); ELSE DBMS_OUTPUT.PUT_LINE('The number ...