Oracle PLSQL Tutorial
Oracle PLSQL Tutorial
Share on your Social
Media Featured
Articles
Oracle PL/SQL Tutorial
Published On: July 1, 2024
Want to know
more about
Oracle PL/SQL Tutorial becoming an
expert in IT?
PL/SQL or procedural language/structured query
language, is a combination of SQL with the
procedural features of programming languages. Click Here to Get
We’ll provide you with a solid foundation in this Started
PL/SQL tutorial so you can go on to the Oracle
database and other advanced RDBMS concepts. 100%
Placement
Quick Enquiry
Assurance
Download Oracle PL/SQL Tutorial PDF
Features of PL/SQL
Applications of PL/SQL
Step 1: Now let’s use the setup file to start the Oracle
Database Installer. Now you can enter your email
address. Press the next button.
Oracle PLSQL Tutorial 1
sqlplus “/ as sysdba”
-2,147,483,648
Signed
PLS_Integer to 2,147,483,647
Integer
/ 32 bits.
-2,147,483,648
Signed through
BINARY_Integer
Integer 2,147,483,647 /
32 bits.
IEEE 754-format
Single-
BINARY_Float floating-point
precision
number
IEEE 754-format
Double-
BINARY_Double floating-point
precision
number
ANSI-specific maximum
NUMBER(prec,
fixed-point precision of 38
scale)
type decimal digits
IBM-specific maximum
DECIMAL(prec,
fixed-point precision of 38
scale)
type decimal digits
maximum
NUMERIC(pre,
Floating type precision of 38
scale)
decimal digits
ANSI-specific maximum
DOUBLE
floating-point precision of 126
PRECISION
type binary digits
ANSI and
maximum
IBM-specific
FLOAT precision of 126
floating-point
binary digits
type
maximum
ANSI-specific
INT precision of 38
integer type
decimal digits
maximum
Floating-
REAL precision of 63
point type
binary digits.
DECLARE
num1 INTEGER;
num2 REAL;
BEGIN
null;
END;
Fixed-length
maximum size
NCHAR national
of 32,767 bytes
character string
Variable-length
maximum size
NVARCHAR2 national
of 32,767 bytes
character string
Variable-length
maximum size
LONG RAW binary or byte
of 32,760 bytes
string
the address of
Physical row
ROWID a row in an
identifier
ordinary table
physical,
Universal row logical, or
UROWID
identifier foreign row
identifier
SQL statements
Built-in SQL functions (such as TO_CHAR)
SQL statements that call PL/SQL routines.
Any nonzero
YEAR -4712 to 9999
integer
MONTH 01 to 12 0 to 11
Any nonzero
DAY 01 to 31
integer
HOUR 00 to 23 0 to 23
MINUTE 00 to 59 0 to 59
Syntax
Example
name varchar2(25);
address varchar2(100);
Example
DECLARE
a integer := 10;
b integer := 20;
c integer;
f real;
BEGIN
c := a + b;
dbms_output.put_line(‘Value of c: ‘ || c);
f := 70.0/3.0;
dbms_output.put_line(‘Value of f: ‘ || f);
END;
Output
Value of c: 30
Value of f: 23.333333333333333333
Example
DECLARE
— Global variables
BEGIN
DECLARE
— Local variables
BEGIN
END;
END;
Output
Declaring a Constant
The CONSTANT keyword is used to declare a
constant. It demands a starting value and prevents
modifications to that value.
Example
DECLARE
— constant declaration
— other declarations
radius number(5,2);
dia number(5,2);
BEGIN
— processing
radius := 9.5;
dia := radius * 2;
— output
dbms_output.put_line(‘Radius: ‘ || radius);
dbms_output.put_line(‘Diameter: ‘ || dia);
dbms_output.put_line(‘Circumference: ‘ || circumference);
dbms_output.put_line(‘Area: ‘ || area);
END;
Output
Radius: 9.5
Diameter: 19
Circumference: 59.69
Area: 283.53
PL/SQL procedure successfully completed.
PL/SQL Literals
Numeric Literals
Character Literals
String Literals
BOOLEAN Literals
Date and Time Literals
Character
‘A’ ‘%’ ‘9’ ‘ ‘ ‘z’ ‘(‘
Literals
BOOLEAN
TRUE, FALSE, and NULL.
Literals
Example
DECLARE
BEGIN
dbms_output.put_line(message);
END;
Output
Arithmetic operators
Relational operators
Comparison operators
Logical operators
String operators
Arithmetic Operators
A + B will
+ Adds two operands
give 15
A * B will
* Multiplies both operands
give 50
The exponentiation
A ** B will
operator raises one
** give
operand to the power of
100000
another
Relational Operators
It determines whether or
not the values of two
(A != B) is
!=<>~= operands are equal; if
true.
they are not, the
condition is met.
Comparison Operators
Operator Description
Logical Operators
Example
DECLARE
BEGIN
dbms_output.put_line(UPPER(greetings));
dbms_output.put_line(LOWER(greetings));
dbms_output.put_line(INITCAP(greetings));
END;
Output
HELLO WORLD
hello world
Hello World
World
ello World
Conclusion
We hope this PL/SQL tutorial gives you a basic
understanding of Oracle PL/SQL. Gain expertise with
our PL/SQL training in Chennai to begin a career in
database management.
Navigation
About Us
Blog Posts
Careers
Contact
Softlogic Academy Placement Training
Softlogic Systems Corporate Training
Hire With Us
KK Nagar [Corporate Office]
Job Seekers
No.10, PT Rajan Salai, K.K. Nagar, Chennai SLA’s Recently Placed Students
– 600 078.
Reviews
Landmark: Karnataka Bank Building
Phone: +91 86818 84318 Sitemap
Email: enquiry@softlogicsys.in
Important Links
Map: Google Maps Link
Disclaimer
OMR
Privacy Policy
No. E1-A10, RTS Food Street Terms and Conditions
92, Rajiv Gandhi Salai (OMR),
Navalur, Chennai - 600 130.
Landmark: Adj. to AGS Cinemas
Phone: +91 89256 88858
Email: info@softlogicsys.in
Map: Google Maps Link
Embedded Mouthshut
Sitejabber