PL SQL Tutorial


PL SQL Operators Tutorial

OperatorMeaningExamples
;Statement Terminator,Declaration Terminator
||Concatenation Operatoranimal:='DOG';
sound:='BARK';
animal_sound := animal||sound;
+,-,*,/Addition(+)
Substraction(-)
Multiplication(*),Division(/)
**Exponentiation Operatordbms_output.put_line(2**3);
8, This operator used in PL/SQL code only
:=Assignment Operatorx:=10;y:=20;b=True;
=Equality OperatorEquality checked in Where Conditions, Control Statements ,Loops etc.,
<> , !=, ~=, ^=Inequality Operators1<>2
%Attribute IndicatorUSed in variable type declarations.for ex:
x number;
y x%TYPE;
z y%TYPE;
>,>=,<,<=Greater Than(>)
Greater Than or Equal To(>=)
Less Than(<)
Less Than or Equal(<=)
and , orLogical Operator 'and', Logical operator 'or'
=>Association operator(named arguments)Calling functions/Procedures may require parameters, variable_name=>value, can be used for better readability.
..Range Operatorused in for loops, where you specify range of numbers 1..10(from to 10)both inclusive
.Componet Indicator(records,packages))This operator(.) is used to access Record Fields, and also Package members
,Item SeperatorSelect statement, comma(,) is used to seperate columns
'Literal DelimterString liternals are sourrended by single Quote(') delimiter
for ex: 'KING'
"Quoted Literal Delimiter
<< Label >> Label DelimiterOptionally you can label each loop for readability Purpose
:Host Variable Indicator
@Remote Database Indicator(database link)This symbol is used in connecting to Remote Database Connection

ADS