Difference between Oracle PL/SQL programming and Java Programming Language

Oracle PL/SQL
JAVA
Variable declaration

T1 Number (8,2);
T2 Number (5) := 5;
T3 Varchar2(23);
T4 Date;
T5 Char;
Variable declaration

String T1;
int T2;
double T3;
Date T4 = new Date();
char T5;
if condition in PL/SQL

IF (condition) THEN
statement;
statement;
ELSE
statement;
statement;
END IF;
if condition in Java

if (condition){
statement;
statement;
}else {
statement;
statement;
}
Exception handling

BEGIN
statement;
statement;
statement;
EXCEPTION
WHEN (exception) THEN
statement;
statement;
END;
Exception handling

try{
statement;
statement;
}
catch (Exception ex){
statement;
}
finally {
statement;
}
For Loop

FOR i IN [REVERS] low..upper
statement; statement;
END LOOP;
For Loop

for (int; condition; inc){
statement;
statement;
}
While Loop

WHILE (condition) LOOP
statement;
statement;
END LOOP;
While Loop

while (condition){
statement;
statement;
}

Comments

Popular posts from this blog

What is Oracle Integration Cloud Service - ICS?

How to Create Packages in Oracle Database using TOAD for Oracle

How to create a Simple Scheduler Job in Oracle Database using Toad