ACCEPT scale PROMPT 'Enter your input scale (C or F) for temperature: ';
ACCEPT temp PROMPT 'Enter your temperature value to be converted: ';
DECLARE
v_scale CHAR(1) := UPPER('&scale');
v_temp NUMBER := '&input';
BEGIN
IF (v_scale) = ('F') THEN
v_temp := (v_temp - 32) * 5/9;
DBMS_OUTPUT.PUT_LINE ('You converted temperature in C is exactly ' || TO_CHAR(v_temp));
ELSIF (v_scale) = ('C') THEN
v_temp := (v_temp * 9/5) + 32;
DBMS_OUTPUT.PUT_LINE ('You converted temperature in F is exactly ' || TO_CHAR(v_temp));
ELSE
DBMS_OUTPUT.PUT_LINE ('This is NOT a valid scale. Must be C or F.');
END IF;
END;
/
When I run the code it ask me for the 2 inputs which I enter like F and 100. Then it only displays "PL/SQL procedure successfully completed".
It looks like it never runs the DBMS_OUTPUT.PUT_LINE ?? How come?? I am new to pl sql so sorry for any newvie mistakes above
Thanks