I'm using the Oracle Developer Days image to get started with PL/SQL in SQL Developer.
Right now I have the following PL/SQL anonymous block:
DECLARE
v_country_name VARCHAR2(40);
v_region_id NUMBER;
BEGIN
SELECT country_name, region_id
INTO v_country_name, v_region_id
FROM countries
WHERE country_id = 'CA';
DBMS_OUTPUT.PUT_LINE('The country name is: ' || v_country_name ||
' and is located in ' || v_region_id || '.');
EXCEPTION
WHEN TOO_MANY_ROWS THEN
DBMS_OUTPUT.PUT_LINE('Your SELECT statement retrieved multiple rows. ' ||
' Consider using a cursor.');
END;
This executes, but it doesn't do what I want it to do. The Script Output only contains 'anonymous block completed'.
I have tried to explicitly enable the output with DBMS_OUTPUT.enable; but this didn't make a difference.
What am I overlooking?