oracle

Saturday, 29 April 2017

PL/SQL: If Statement

If statement is descision making statement. You will check the condition and perform any action based on the outcome of if statement.
The outcome of if statement is either True or False.

Syntax:
If condition then
statement(s);
end if;

For example:


Example:
declare
vsalary number(10,2);
begin
select salary into vsalary from employees where employee_id=100;
if vsalary>6000 then
dbms_output.put_line('He earn more than TOM');
end if;
end;

Result:
He earn more than TOM

No comments:

Post a Comment