Terdapat tiga bentuk perintah-perintah IF: IF-THEN, IF-THEN-ELSE, dan IF-THEN-ELSE-IF.
Macam-Macam Bentuk Umum Kondisi.
Perintah IF-THEN
Bentuk umum :
IF condition THEN
sequence_of_statements
END IF;
.
Perintah IF-THEN-ELSE
Bentuk umum :
IF condition THEN
sequence_of_statements1
ELSE
sequence_of_statements2
END IF;
Perintah IF-THEN-ELSIF
Bentuk umum :
IF condition1 THEN
sequence_of_statements1
ELSIF condition2 THEN
sequence_of_statements2
ELSE
sequence_of_statements3
END IF;
Perintah CASE
Bentuk umum :
[<>]
CASE selector
WHEN expression1 THEN sequence_of_statements1;
WHEN expression2 THEN sequence_of_statements2;
…
WHEN expressionN THEN sequence_of_statementsN;
[ELSE sequence_of_statementsN+1;]
END CASE [label_name];
Tidak ada komentar:
Posting Komentar