----------------------------------------------------------------------
DECLARE
conVerson constant VARCHAR2(20) := '1.0.01';
BEGIN
DBMS_OUTPUT.put_line(conVerson);
END;
----------------------------------------------------------------------
DECLARE
Database VARCHAR2(50) := 'Oracle 10g';
BEGIN
dbms_output.put_line(Database);
END;
----------------------------------------------------------------------
DECLARE
Database VARCHAR2(50);
BEGIN
Database := 'Oracle 11g';
dbms_output.put_line(Database);
END;
----------------------------------------------------------------------
DECLARE
Num INTEGER := 11;
BEGIN
IF Num 0 THEN
dbms_output.put_line('正数');
ELSE
dbms_output.put_line('0');
END IF;
END;
----------------------------------------------------------------------
DECLARE
varDAY INTEGER := 5;
Result VARCHAR2(20);
BEGIN
Result := CASE varDAY
WHEN 1 THEN
'日曜日'
WHEN 2 THEN
'火曜日'
WHEN 3 THEN
'水曜日'
WHEN 4 THEN
'木曜日'
WHEN 5 THEN
'金曜日'
WHEN 6 THEN
'土曜日'
WHEN 7 THEN
'月曜日'
ELSE
'数字越界'
END;
dbms_output.put_line(Result);
END;
----------------------------------------------------------------------
DECLARE
V_num INTEGER := 1;
V_sum INTEGER := 0;
BEGIN
LOOP
V_sum := V_sum + V_num;
dbms_output.put_line(V_num);
IF V_num = 10 THEN
EXIT;
END IF;
dbms_output.put_line('+');
V_num := V_num + 1;
END LOOP;
dbms_output.put_line('=');
dbms_output.put_line(V_sum);
END;
----------------------------------------------------------------------
DECLARE
V_num INTEGER := 1;
V_sum INTEGER := 0;
BEGIN
LOOP
V_sum := V_sum + V_num;
dbms_output.put_line(v_num);
EXIT WHEN V_num = 9;
dbms_output.put_line('+');
V_num := V_num + 1;
END LOOP;
dbms_output.put_line('=');
dbms_output.put_line(V_sum);
END;
----------------------------------------------------------------------
DECLARE
v_Num INTEGER := 1;
v_Sum INTEGER := 0;
BEGIN
WHILE v_Num