oracle-databaseplsqldbeaver

Query function or procedure ouput doesn't existing in dbeaver version 24


CREATE OR REPLACE PROCEDURE display_employees2 IS 
    CURSOR emp_cursor IS 
        SELECT 
            FIRST_NAME || ' ' || LAST_NAME AS full_name, 
            PHONE_NUMBER, 
            HIRE_DATE, 
            SALARY
        FROM employees2;
    v_full_name varchar(100);
    v_phone_number employees2.phone_number%TYPE;
    v_hire_date employees2.hire_date%TYPE;
    v_salary employees2.salary%TYPE;
BEGIN
    OPEN emp_cursor;
    LOOP
        FETCH emp_cursor INTO 
            v_full_name,
            v_phone_number,
            v_hire_date,
            v_salary;
        EXIT WHEN emp_cursor%NOTFOUND;
        dbms_output.put_line('Name         : ' || v_full_name);
        dbms_output.put_line('Phone number : ' || v_phone_number);
        dbms_output.put_line('Hire Date    : ' || v_hire_date);
        dbms_output.put_line('Salary       : ' || v_salary);
        dbms_output.put_line('--------------------');
    END LOOP;
    CLOSE emp_cursor;
END display_employees2;

I want my query output shown


Solution

  • You call your procedure from an anonymous block

    BEGIN
        DBMS_OUTPUT.ENABLE(NULL);
        display_employees2;
    END
    ;
    /
    

    You execute it with the "Execute script" button (alt-X) and the Output tab will be opened automatically… at least it's how it works here.