Siiragill Blog's

Welcome To siiragill.blogspot.com

Perulangan dan kondisi pada PL/SQL



bentuk umum perulangan dan kondisi pada pl/sql
Perulangan
Loop
Sequence statement
End loop;

While loop
While condition loop
Sequence of statement
End loop;

Kondisi
If_then
If condition then
Sequence of statement
End if;


If_then_else
If condition then
Sequence of statement
Else
If condition then
Sequence of statement
End if;


contoh sederhana perulangan & condisi pada pl/sql
Declare
Type datelist is table of date index by binary_intege;
Dates constant integer:=5;
Begin
For j in 1..3 loop
Dates (j*k):=sysdate
End loop;
End;

Declare
Pharga number(5);
Begin
Pharga :=100;
If (pharga=100_ then
Dbms_output.put_line(‘harga 100’)
End if;
End;

0 komentar:

Posting Komentar